Wrong position sprite on tilemap

Wrong position sprite on tilemap
0.0 0


Hi everyone,

For some days i have tried to put a sprite on tile map.

When i do :

sprite->setPosition(backgroundLayer->positionAt(ccp(0, 0)));

the sprite is set to 0, 1 :


my anchor point for this sprite is :

sprite->setAnchorPoint(ccp(0.5, 0.5));

Furthermore the sprite has the same size of one tile.

To set the sprite to the position (0,0) on the tilemap i need to do :

sprite->setPosition(backgroundLayer->positionAt(ccp(0, -1)));


Why the axis Y range is [–1:18] and X axis range is [0:20] ?

The mark looks like the follow picture :


Have you got some ideas ?



When I started learning 2.2 I used code the like this


to try simple case to see how the positions work with tilemaps.