0

私の cocos2d iphone プロジェクトでは、タイル マップを追加しようとしています。タイル マップには画像レイヤーが 1 つしかありません。以下のコードでこの tiledMap を追加しようとしています。

-(id) init
{
if( (self=[super init])) {
    theMape = [CCTMXTiledMap tiledMapWithTMXFile:@"demomap.tmx"];
    [self addChild:theMape z:1];
}
return self;
}

私のタイルマップのソースは次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="20" height="180" tilewidth="32" tileheight="32">
<tileset firstgid="1" name="block" tilewidth="32" tileheight="32">
<image source="block.png" width="90" height="34"/>
<tile id="0">
<properties>
  <property name="type" value="base"/>
</properties>
</tile>
</tileset>
<imagelayer name="backgorund" width="20" height="180">
 <image source="bgimage.png"/>
</imagelayer>
</map>

そして、リソースフォルダーにbgimage.pngファイルがあります。

タイル レイヤーのみが含まれている場合は、そのレイヤーが表示されます。これの何が悪いのかわからない?

4

1 に答える 1