Found a bug with CCTMXLayer when using Retina mode in “cocos2d-1.0.0-x-0.9.0”. Have fixed it - see my modified CCTMXLayer.cpp and CCTMXLayer.h attached, just search for “Gav T”.
Fixes are a few lines to account for a “ContentScaleFactor” of 2 in Retina including:-
“m_tMapTileSize” came out double what it should be in the function “CCTMXLayer::initWithTilesetInfo(…)”, also…
“rectForGID” came back with a rect twice the size in function “CCTMXLayer::appendTileForGID(…)”.
This version is fixed and tested a bit more. Works with Retina mode TMX Tiled maps including multi layered and calls to functions which add and remove tiles like tileAt(…).
i recently notices the same problem
thanks for this fix
i am working with the objective-c version of cocos2d and tried porting your fix but it did not work, i guess i did something wrong
do i need to have a -hd version of the tmx file or something?
hope to see this fix in a cocos2d release
`rakka - I’ll take a look at the Cocos2D version and get back to you. In answer to your hd question yeah you need the -hd and the normal files (2 TMX files and 2 PNG files).
The Retina TMX problem seems to be back in the latest versions of Cocos2d-x. I’m using version “cocos2d-1.0.1-x-0.11.0 @ Jan 13, 2012” and it works fine. “cocos2d-1.0.1-x-0.12.0 @ Mar 05, 2012” and on no longer work.