Hi,
I have a problem that don’t found solution, I search and read a lot of post but nothing work.
I have some SKSpriteNode with transparent area and I need detect the touch only on the non transparent area.
With…
if let touchedBody:SKPhysicsBody = self.physicsWorld.body(at: pos) { if let theSprite:SKSpriteNode = touchedBody.node as? SKSpriteNode { print(theSprite) } }
Only work the last one SKSpriteNode and only at some locations inside the non transparent sprite.
With…
for node in nodes(at: pos) { if (node.name != "gameboard"){ print("Node position \(node.position) name \(node.name)") } }
I get all the nodes at location, but only is valid the non transparent.
I try to get the alpha value of the texture but I’m blocked…
Any other way to solve this? What I’m doing wrong?