【发布时间】:2012-04-12 06:50:18
【问题描述】:
在我的例子中,我正在制作一个 2D 游戏,相机总是跟随我的角色,但是会有场景限制,所以当他几乎靠近场景边界时我必须停止跟随他。我还必须处理相机比例,所以我必须决定是使用 CCFollow::actionWithTarget() 还是 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 游戏中使用它。
【问题讨论】:
-
你找人澄清一下吗?我有类似的疑问,很高兴知道你是否解决了这些疑问..
标签: c++ ios cocos2d-iphone