【发布时间】:2012-11-02 17:25:16
【问题描述】:
如何找到 CCSprite 的中心点?
我的伪代码是:
A get sprite bounding box
B compute center point of the sprite
C move center point relative to sprite position and anchor point (this will be the center point of the sprite)
到目前为止,我的伪解决方案是这样的:
A [精灵边界框] 乙How to find the Center Coordinate of Rectangle? C 我不知道:)
有什么建议吗?
【问题讨论】:
-
看不懂C点下的意思。
-
@Morion 我只是假设要获得精灵的精确中心,我需要相对于它的锚点计算它(比如锚点是 (0,0) 而不是传统的 (0.5 , 0.5) ,但我不确定。
标签: ios math cocos2d-iphone sprite