TMXGenerator
==================
TMX Generator used as a delegate to create TMX maps based on data that is fed into it.
Intended for use in situations where tile maps are to be generated on the fly rather than pre-built.
This could be used for many things including top-down world maps, shooters, and platformers.
Features
----------------------------
* Generates TMX maps with both object and tile layers.
* TMX files have one atlas per layer.
* Custom property support for layers, objects and tiles.
* Custom filenames supported.
* TMX tile rotation support (Unofficial).
* Universal support (iPhone + iPad + Mac)
* TMXGenerator can be used with most any cocoa project.
* Easy to use
Limitations
----------------------------
1. The tile flipping that was introduced in Tiled 0.7 (July 2011) is not yet supported.
Usage
----------------------------
- Set up your data class to implement the TMXGeneratorDelegate protocol.
- Create a TMXGenerator object (with alloc and init).
- Set your desired data class as it's delegate.
- call the method generateAndSaveTMXMap: to allow for the map to be generated.
- release your TMXGenerator object.
delegate methods
----------------------------
TMXGenerator uses your delegate functions to feed itself data in order to write a TMX file.
A summation of the steps the generator goes through are as follows:
* Get the overall map width and height, tile width and height and file path.
* Generate the atlas tileset information and atlas information.
* Generate the layer and tile rotation information (in name array order).
* Generate the object layer information.
* Write the new TMX file.
* Copy the image atlas to the same location as the TMX file.
A list of the delegate methods and optional delegate methods is below.
- (NSString*) mapFilePath; // returns the map's filePath to be saved to.
- (NSDictionary*) mapSetupInfo; // returns map setup parameters. Keys listed above. Number values can be strings or NSNumbers.
- (NSDictionary*) tileSetInfoForName:(NSString*)name; // returns tileset setup information based on the name. Keys listed above.
- (NSDictionary*) layerInfoForName:(NSString*)name; // returns layer setup information based on the name passed. Keys listed above.
- (NSArray*) objectsGroupInfoForName:(NSString*)name; // returns object group information based on the name passed. Keys listed above.
// The order of array items returned here determine the heirarchy of objects and layers.
- (NSArray*) layerNames; // returns all layer names as an array of NSStrings.
- (NSArray*) tileSetNames; // returns the names of all tilesets as NSStrings.
- (NSArray*) objectGroupNames; // returns the names of all the object groups as NSStrings.
- (NSString*) tileIdentificationKeyForLayer:(NSString*)layerName; // returns the key to look for in the tile properties when assigning tiles during map creation.
- (NSString*) tileSetNameForLayer:(NSString*)layerName; // returns the name of the tileset (only one right now) for the layer.
- (NSString*) tilePropertyForLayer:(NSString*)layerName // returns a uniquely identifying value for the key returned in the method keyForTileIdentificationForLayer:
tileSetName:(NSString*)tileSetName // If the value is not found, the tile gets set to the minimum GID.
X:(int)x
Y:(int)y;
optional delegate methods
----------------------------
- (NSDictionary*) propertiesForTileSetNamed:(NSString*)name; // returns the optional properties for a given tileset.
- (NSArray*) propertiesForObjectWithName: (NSString *) name // returns the optional properties for a given object in a given group.
inGroupWithName: (NSString *) groupName;
- (int) tileRotationForLayer:(NSString*)layerName // returns a rotation value for the specified tile name and tile.
X:(int)x // (no rotation is created if this method doesn't exist)
Y:(int)y;
Tip: Look at the example code provided for an easy way to attach tiles on a layer using properties.
Dependencies
----------------------------
1. LFCGzipUtility.m / .h
2. cencode.c / .h
(or appropriate substitutes as desired)
License and Attribution
----------------------------
Copyright (c) 2011 Stone Software and Jeremy Stone. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
LFCGzipUtility.m / .h Copyright (c) 2009 Clint Harris (www.clintharris.net)
http://www.clintharris.net/2009/how-to-gzip-data-in-memory-using-objective-c/
cencode.c / .h is Copyright (c) 2006-2007, Philip Busch <broesel@studcs.uni-sb.de>, All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
没有合适的资源?快使用搜索试试~ 我知道了~
IOS应用源码之cocos2d-cocos2d-iphone-extensions-v0.2-0-ge42002b.zip
共319个文件
ccz:160个
png:45个
h:34个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 149 浏览量
2022-06-22
10:39:25
上传
评论
收藏 24.32MB ZIP 举报
温馨提示
IOS应用源码之cocos2d-cocos2d-iphone-extensions-v0.2-0-ge42002b.zip
资源推荐
资源详情
资源评论
收起资源包目录
IOS应用源码之cocos2d-cocos2d-iphone-extensions-v0.2-0-ge42002b.zip (319个子文件)
cencode.c 10KB
bigImage_1_14-hd.pvr.ccz 229KB
bigImage_3_14-hd.pvr.ccz 229KB
bigImage_1_5-hd.pvr.ccz 228KB
bigImage_3_5-hd.pvr.ccz 227KB
bigImage_3_13-hd.pvr.ccz 218KB
bigImage_1_13-hd.pvr.ccz 217KB
bigImage_3_6-hd.pvr.ccz 217KB
bigImage_1_6-hd.pvr.ccz 217KB
bigImage_3_8-hd.pvr.ccz 212KB
bigImage_1_11-hd.pvr.ccz 212KB
bigImage_1_8-hd.pvr.ccz 212KB
bigImage_3_11-hd.pvr.ccz 212KB
bigImage_1_7-hd.pvr.ccz 204KB
bigImage_3_12-hd.pvr.ccz 204KB
bigImage_3_7-hd.pvr.ccz 203KB
bigImage_1_12-hd.pvr.ccz 203KB
bigImage_3_9-hd.pvr.ccz 198KB
bigImage_3_10-hd.pvr.ccz 197KB
bigImage_1_9-hd.pvr.ccz 197KB
bigImage_1_10-hd.pvr.ccz 197KB
bigImage_2_14-hd.pvr.ccz 97KB
bigImage_0_14-hd.pvr.ccz 94KB
bigImage_2_5-hd.pvr.ccz 92KB
bigImage_0_5-hd.pvr.ccz 92KB
bigImage_2_13-hd.pvr.ccz 81KB
bigImage_2_7-hd.pvr.ccz 79KB
bigImage_2_12-hd.pvr.ccz 79KB
bigImage_2_6-hd.pvr.ccz 78KB
bigImage_0_6-hd.pvr.ccz 77KB
bigImage_0_7-hd.pvr.ccz 77KB
bigImage_0_12-hd.pvr.ccz 77KB
bigImage_0_13-hd.pvr.ccz 76KB
bigImage_2_16-hd.pvr.ccz 75KB
bigImage_0_15-hd.pvr.ccz 73KB
bigImage_2_15-hd.pvr.ccz 73KB
bigImage_0_16-hd.pvr.ccz 72KB
bigImage_2_8-hd.pvr.ccz 72KB
bigImage_2_3-hd.pvr.ccz 72KB
bigImage_0_8-hd.pvr.ccz 72KB
bigImage_0_11-hd.pvr.ccz 72KB
bigImage_0_3-hd.pvr.ccz 72KB
bigImage_2_11-hd.pvr.ccz 71KB
bigImage_2_18-hd.pvr.ccz 71KB
bigImage_0_18-hd.pvr.ccz 71KB
bigImage_3_16-hd.pvr.ccz 71KB
bigImage_2_4-hd.pvr.ccz 70KB
bigImage_1_16-hd.pvr.ccz 70KB
bigImage_0_4-hd.pvr.ccz 69KB
bigImage_1_3-hd.pvr.ccz 69KB
bigImage_3_3-hd.pvr.ccz 69KB
bigImage_2_1-hd.pvr.ccz 68KB
bigImage_3_18-hd.pvr.ccz 68KB
bigImage_1_18-hd.pvr.ccz 67KB
bigImage_3_15-hd.pvr.ccz 67KB
bigImage_1_15-hd.pvr.ccz 67KB
bigImage_3_19-hd.pvr.ccz 66KB
bigImage_3_0-hd.pvr.ccz 66KB
bigImage_3_4-hd.pvr.ccz 66KB
bigImage_3_1-hd.pvr.ccz 66KB
bigImage_0_1-hd.pvr.ccz 65KB
bigImage_1_19-hd.pvr.ccz 65KB
bigImage_1_1-hd.pvr.ccz 64KB
bigImage_1_4-hd.pvr.ccz 64KB
bigImage_1_17-hd.pvr.ccz 62KB
bigImage_3_17-hd.pvr.ccz 62KB
bigImage_1_0-hd.pvr.ccz 62KB
bigImage_2_10.pvr.ccz 61KB
bigImage_3_2-hd.pvr.ccz 61KB
bigImage_1_2-hd.pvr.ccz 61KB
bigImage_2_17-hd.pvr.ccz 60KB
bigImage_2_2-hd.pvr.ccz 60KB
bigImage_0_17-hd.pvr.ccz 59KB
bigImage_0_2-hd.pvr.ccz 58KB
bigImage_2_17.pvr.ccz 57KB
bigImage_2_12.pvr.ccz 57KB
bigImage_2_13.pvr.ccz 57KB
bigImage_2_11.pvr.ccz 56KB
bigImage_2_16.pvr.ccz 56KB
bigImage_2_19-hd.pvr.ccz 56KB
bigImage_2_19.pvr.ccz 55KB
bigImage_2_14.pvr.ccz 55KB
bigImage_0_19-hd.pvr.ccz 54KB
bigImage_3_10.pvr.ccz 53KB
bigImage_2_0-hd.pvr.ccz 52KB
bigImage_2_15.pvr.ccz 52KB
bigImage_0_0-hd.pvr.ccz 50KB
bigImage_2_18.pvr.ccz 50KB
bigImage_3_13.pvr.ccz 48KB
bigImage_2_10-hd.pvr.ccz 48KB
bigImage_3_11.pvr.ccz 47KB
bigImage_0_9-hd.pvr.ccz 47KB
bigImage_2_9-hd.pvr.ccz 47KB
bigImage_3_12.pvr.ccz 47KB
bigImage_3_16.pvr.ccz 46KB
bigImage_3_17.pvr.ccz 46KB
bigImage_3_14.pvr.ccz 45KB
bigImage_0_10-hd.pvr.ccz 44KB
bigImage_3_15.pvr.ccz 44KB
bigImage_3_18.pvr.ccz 43KB
共 319 条
- 1
- 2
- 3
- 4
资源评论
BryanDing
- 粉丝: 297
- 资源: 5587
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功