标签:style blog color io os sp div on log
CCPoint HelloWorld::positionToTileCoord(CCPoint pos) { int x = pos.x / map->getTileSize().width; int y = ((map->getMapSize().height * map->getTileSize().height) - pos.y) / map->getTileSize().height; return ccp(x,y); } CCPoint HelloWorld::tilecoordToPosition(CCPoint tileCoord) { int x=tileCoord.x * map->getTileSize().width + map->getTileSize().width/2; int y=map->getMapSize().height * map->getTileSize().height - tileCoord.y * map->getTileSize().height - map->getTileSize().height/2; return ccp(x, y); }
已验证
标签:style blog color io os sp div on log
原文地址:http://www.cnblogs.com/ycclmy/p/4023424.html