简体   繁体   中英

ccmenuitem click response position is off after changing cccamera coordinates

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 ? :(

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM