How to handle touch event properly in a scaled node

I have a board game in which the whole board and other sprites that moves on touch event are there. Touch event is handled inside that node based class. For some reason I have to scale down the node to make it fit for ipads. But the touch doesn’t work properly. Touch points location and the actually sprites location after scaling down the node is not matching. How can I fix this issue ?
P.S. I’m not using director->setContentScaleFactor. Just scaled down a node.

How do you handle touches?

Like in the regular way, inside a custom class (node extended). Only the problem is with touch location and actual position of the sprites is not matching.

Convert the touch location to node space.

this->convertToNodeSpace(point)
1 Like

Thanks a lot :slight_smile: it worked :slight_smile:
You are a savior :smiley: