cocos2d-x 瓦片地图CCTMXTiledMap和图层类CCTMXLayer

1、CCTMXTiledMap

CCTMXLayer* layer =  map->layerNamed( "layer_0");



2、CCTMXLayer

//返回图层尺寸的大小virtual const CCSize & getLayerSize (void)

 //设置图层尺寸的大小virtual void setLayerSize (const CCSize &var)
 //返回砖块尺寸的大小virtual const CCSize & getMapTileSize (void)
 //设置砖块尺寸的大小virtual void setMapTileSize (const CCSize &var)
 //返回砖块属性信息virtual CCTMXTilesetInfo * getTileSet (void)
 //设置砖块属性信息virtual void setTileSet (CCTMXTilesetInfo *var)
 //返回图层属性字典(包含了所有属性)virtual CCDictionary * getProperties (void)
 //设置图层属性virtual void setProperties (CCDictionary *var)
 //初始化函数,参数为:砖块配置对象,图形配置对象,地图配置对象bool initWithTilesetInfo (CCTMXTilesetInfo *tilesetInfo, CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo)
 //释放图层中砖块的拼接信息void releaseMap ()
 //返回指定位置的砖块对象CCSprite * tileAt (const CCPoint &tileCoordinate)
 //返回指定位置砖块对象的IDunsigned int tileGIDAt (const CCPoint &tileCoordinate)
 //返回指定位置砖块对象的IDunsigned int tileGIDAt (const CCPoint &tileCoordinate, ccTMXTileFlags *flags)
 //设置指定位置砖块对象的IDvoid setTileGID (unsigned int gid, const CCPoint &tileCoordinate)
 //设置指定位置砖块对象的IDvoid setTileGID (unsigned int gid, const CCPoint &tileCoordinate, ccTMXTileFlags flags)
 //移除指定位置砖块对象void removeTileAt (const CCPoint &tileCoordinate)
 //返回指定坐标的地图位置CCPoint positionAt (const CCPoint &tileCoordinate)
 //返回指定属性数值CCString * propertyNamed (const char *propertyName)
 //创建图层中的砖块void setupTiles ()
 //得到图层的名字const char * getLayerName ()
 //设置图层的名字void setLayerName (const char *layerName)


-----------------------
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值