0
votes

i am building my first sprite kit game. so far so good - i'm almost ready to release. i am however having an issue with incredibly hard to touch nodes (for the user)

flow

  • nodes are spawned with size (0,0)
  • nodes are then zoomed with SKActions (scaleTo) to some max_size
  • user taps the node at a point between (0,0) and (max_size, max_size)
  • tap is registered and game proceeds

problem

the hit area of the node of course is only as big as the currently shown scalefactor. this means to hit the node right at spawn the user would have to hit a (1,1) pixel field (or similar)

question

is there a convenient way to have the area registering the tap at (max_size,max_size) from the very beginning?

1

1 Answers

2
votes

You can add the node as a child of an SKSpriteNode that's max_size x max_size. You can set the color of the SKSpriteNode to SKColor.clearColor() to make it invisible. The position of the child node should be (0,0).