Skip to content

Commit 9df89a1

Browse files
committed
Adding resolution based tilemap test.
1 parent c60a29d commit 9df89a1

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed
45.2 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<map version="1.0" orientation="orthogonal" width="10" height="10" tilewidth="32" tileheight="32">
3+
<tileset firstgid="1" name="Desert" tilewidth="32" tileheight="32" spacing="1" margin="1">
4+
<image source="desert_resolution.png"/>
5+
</tileset>
6+
<layer name="Tile Layer 1" width="10" height="10">
7+
<data encoding="base64" compression="gzip">
8+
H4sIAAAAAAAAA5NkYGCQIoClgViRgTBQpoM6JSimljpquw+XOk0g1iKAtYEYAF51CouQAQAA
9+
</data>
10+
</layer>
11+
</map>
55.1 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<map version="1.0" orientation="orthogonal" width="10" height="10" tilewidth="64" tileheight="64">
3+
<tileset firstgid="1" name="Desert" tilewidth="64" tileheight="64" spacing="2" margin="2">
4+
<image source="desert_resolution.png"/>
5+
</tileset>
6+
<layer name="Tile Layer 1" width="10" height="10">
7+
<data encoding="base64" compression="gzip">
8+
H4sIAAAAAAAAA5NkYGCQIoClgViRgTBQpoM6JSimljpquw+XOk0g1iKAtYEYAF51CouQAQAA
9+
</data>
10+
</layer>
11+
</map>

cocos2d-ui-tests/tests/TilemapTest.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,17 @@ -(void) setupTilemap6Test
8787
scroll.scrollPosition = ccp(map.contentSizeInPoints.width/2 - scroll.contentSizeInPoints.width/2, 0);
8888
}
8989

90+
-(void) setupTilemap7Test
91+
{
92+
// These files are in the SB directories.
93+
self.subTitle = @"TileMaps/orthogonal_resolution.tmx";
94+
95+
CCNode *map = [CCTiledMap tiledMapWithFile:self.subTitle];
96+
CCScrollView *scroll = [[CCScrollView alloc] initWithContentNode:map];
97+
scroll.flipYCoordinates = NO;
98+
99+
[self.contentNode addChild:scroll];
100+
scroll.scrollPosition = ccp(map.contentSizeInPoints.width/2 - scroll.contentSizeInPoints.width/2, 0);
101+
}
102+
90103
@end

0 commit comments

Comments
 (0)