gmeister26 at July 25th, 2011 10:53 — #1
I’m having some issues trying to get TMX Maps to show in Retina Display mode. My general sprites work fine in both modes and the TMX Map works for standard size, however when the ~~hd map is loaded everything appears twice as big on the retina display, instead of being the same equivalant size. Has anyone else tried this or am I missing something? Cheers!
tmx = CCTMXTiledMap::tiledMapWithTMXFile(“alpha.tmx”);
tmxBg = tmx~~>layerNamed;
alpha.tmx (16x16 tiles)
alpha-hd.tmx (32x32 tiles)
gmtdev at July 26th, 2011 15:09 — #2
Found the same question here, see if it helps:
gmeister26 at July 26th, 2011 23:43 — #3
Cheers, but I don’t think this is the same issue. I literally just let cocos2d-x load the map and display it, but it doesn’t display correctly on the retina display, it is twice as big as it should be. Has anyone else managed to load and scale a map correctly on the retina display?
gmtdev at August 4th, 2011 14:31 — #4
Just been trying to do Retina TMX tiled maps myself, can’t get it working in Cocos2d-x (v 1.0.0-x-0.9.0).
I’ve posted screen shots of the normal mode map being displayed (this is what the Retina one should look like too a tree and a bix X in front of the Cocos logo), the Retina mode map, and another Retina mode with a modified TMX file.
Editing my HD “map1-hd.tmx” file and changing all tilesizes to their low res value 32 (they should be 64 for my 64x64 tiles) I get a “better” looking result (see TMX_Retina_with_Tilesizes_32.jpg). Of course changing these values is actually wrong and stops it loading into Tiled editor.
Have also attached the progect source file, it is the Helloworld sample. You will see there is a “map1.tmx”, “map1.png”, “map1-hd.tmx”, “map1-hd.png” in the resources. And the only lines of code added are in “bool HelloWorld::init()” which are:
// Set retina display mode
(comment out that line to test low res mode on an iPhone 4) and…
// Load in the TMX tile map
//Map = CCTMXTiledMap::tiledMapWithTMXFile(“map1.tmx”);
Map = CCTMXTiledMap::tiledMapWithTMXFile(“map1.tmx”);
addChild(Map, 0, 1 /*kTagTileMap*/);
Soooo.. am I doing something wrong or is this a bug?
gmtdev at August 5th, 2011 08:47 — #5
edisundong at May 14th, 2012 20:18 — #6
how can i fix this bug?it’s still is a big bug