接触Cocos2D有段时间了,今天特意研究了下Cocos2D坐标系中各种位置关系,anchor属性,CCNode坐标和地图坐标转换。
先看一段代码:
代码如下:
-(id) init
{
// always call “super” init
// Apple recommends to re-assign “self” with the “super” return value
if( (self=[super init])) {
CCTMXTiledMap *gameWorld = [CCTMXTiledMap tile