CCSprite: Incorrect size, color and position on screen

I am working on a iOS project, using tile map style to form a layer. I have a PNG of size 544 x 272, which contain 4 x 2 tiles. I tried to use CCSpriteBatchNode and SpriteFrame to draw the layout, but found a problem: the same tile fit on the whole screen except those on the right, which forming a gap.

After checking by capturing the screen, I found the tiles’s position and size is not even, although they are generated using the same code (i.e. x = i * 136; y = j * 136).

At last, I tried to create a checkerboard pattern with size 150x150, create a CCSprite in code, anchor point zero and position to (10,0). I have attached the screen capture and the sprite file here.

The result is: In the screen capture (iPad Retina, a portion only), the position is (8, –1) instead of (10,0). The size is 151x150 (or, position to (8,0) and size 151x149), the color also showing differences, only the left and right edge is correct.

By the result of this screen capture, can anyone suggest what problem I have?

The setup is just very normal and following those example.


CCSpriteErrorScreenCap.png (28.3 KB)


A.png (0.4 KB)

Have you tried setting the TEXEL stretching stuff?

Could you explain in more details?

I haven’t touch any codes related to TEXEL stretching.