Cocos2D-x - Issues when with using CCFollow

断了今生、忘了曾经 提交于 2019-12-04 18:26:42

ССFollow is often not enough for your own purposes. One way out of this situation is to create your custom ССFollow action or adding the required logic in the game loop.

Please read this article, there's a lot of useful information for your question:
The Four Ways of Implementing a Scrolling View with Cocos2D Explained

It could be that you are instantiating CCFollow before the VisibleBoundsWorldspace of your layer is set to the view width and height (check in a debugger if the VisibleBoundsWorldspace rect has zero width and height).

RunAction(new CCFollow(yourNode, CCRect.Zero));

Shouldn't be in the Layer constructor, somewhere like AddedToScene will work better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!