对于非视网膜我使用此代码请帮助如何在ipad中显示视网膜
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="21" height="16" tilewidth="49" tileheight="48">
<tileset firstgid="1" name="FirstLevel-ipad" tilewidth="49" tileheight="48">
<image source="FirstLevel-ipad.png" width="256" height="256"/>
<tile id="0">
<properties>
<property name="Award" value=""/>
</properties>
</tile>
<tile id="1">
对于Retina我试过
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="21" height="16" tilewidth="98" tileheight="96">
<tileset firstgid="1" name="FirstLevel-ipadhd" tilewidth="98" tileheight="96">
<image source="FirstLevel-ipadhd.png" width="512" height="512"/>
<tile id="0">
<properties>
<property name="Award" value=""/>
</properties>
与项目相关的代码
_tileMap = [CCTMXTiledMap tiledMapWithTMXFile:@"FifthLevel.tmx"];
[self addChild:_tileMap];
_objectLayer = [_tileMap layerNamed:@"Objects"];
_dynamicLayer = [_tileMap layerNamed:@"Dynamic"];
//_coinsLayer = [_tileMap layerNamed:@"Coins"];
_keyLayer = [_tileMap layerNamed:@"Key"];
_shadowLayer = [_tileMap layerNamed:@"Shadow"];
_blastedLayer =[_tileMap layerNamed:@"Blasted"];
答案 0 :(得分:1)
在此,问题是地图的宽度,它大于2048的最大支持宽度。您可以在日志中检查此错误。
视网膜显示屏中TMX贴图的最大支持尺寸 2048 * 2048