ccmenuitem click response position is off after changing cccamera coordinates

123 views Asked by At

I'm developing an ios game with cocos2d currently. There is a ccmenuitem on the screen. As the game starts, the player moves forward. In order to keep the player on the centre of the screen, the cccamera coordinates are changing according to player's position. The problem is when I click on the menuitem after the camera coordinates are changed, it does not response. For example, if the camera coordinates are moved 10 px to the right, I have to click 10px to the right of the the menuitem in order to "click on it". Does any one know how fix this ? :(

1

There are 1 answers

0
CodeSmile On

This is a know side-effect of using CCCamera. There's rarely any need for using the camera though because you can achieve the same scrolling effect by simply moving the layer in the opposite direction.