2
就我而言,我正在制作一款2D游戏,相机总是会跟随我的角色,但会有场景限制,所以当他几乎在场景边界附近时,我不得不停止跟随他。我也必须处理相机的比例,所以我必须决定是否使用CCFollow :: actionWithTarget()或CCCamera。为什么我们更喜欢在cocos2d中使用“CCFollow”而不是“CCCamera”?
在CCCamera.h它说:
限制:
- Some nodes, like CCParallaxNode, CCParticle uses world node coordinates, and they won't work properly if you move them (or any of their ancestors)
using the camera.
- It doesn't work on batched nodes like CCSprite objects when they are parented to a CCSpriteBatchNode object.
- It is recommended to use it ONLY if you are going to create 3D effects. For 2D effecs, use the action CCFollow or position/scale/rotate.
最后一句话很有意思,为什么只用它的3D效果?似乎CCCamera不是由其制作者推荐的。我知道这是处理相机动作的捷径,但我不知道为什么最好不要在2D游戏中使用它。
你有没有找到合适的人来澄清这一点?我有类似的疑问,并且很高兴知道你是否解决了这些疑虑。 – mm24 2012-10-29 09:24:12