Cocos2D-x-使用CCFollow时出现问题 [英] Cocos2D-x - Issues when with using CCFollow
问题描述
我在Cocos2D-X中的CCFollow遇到了问题.我要跟随我的Sprite,将其称为Box2D-Body.
I've got a problem with CCFollow in Cocos2D-X. I want to follow my a Sprite, which is referred to a Box2D-Body.
当我打电话时
this->runAction(CCFollow::create(playerSprite));
在我的GameLayer的init方法中,通常的屏幕的左下角位于设备的中央,并且位于模拟器的中央.
in the init method of my GameLayer, the lower left corner of my usual screen is centered on my device and although the emulator.
有人可以帮助我解决这个问题吗? :/
May anyone help me with this issue ? :/
最好的问候,
存储
推荐答案
ССFollow通常不足以满足您的目的.解决这种情况的一种方法是创建自定义ССFollow动作或在游戏循环中添加所需的逻辑.
СС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.
请阅读这篇文章,这里有很多关于您的问题的有用信息:
解释了使用Cocos2D实现滚动视图的四种方法
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
这篇关于Cocos2D-x-使用CCFollow时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!