CocosCreator知识库<二>关于TiledMap的系统学习教程<26/12/2017>(长期更新,看不懂先大致总体搞一遍,然后回头细看)
TiledMap官网:(不收费,点击Nothanks免费下载最新版)
传送门:http://www.mapeditor.org/
推荐教程<零>TiledMap瓦片地图(potato47)
传送门:http://blog.csdn.net/potato47/article/details/51366481
基础教程<一>基础功能+地形功能
传送门:http://blog.csdn.net/firseve/article/details/50789526
进阶教程<二>动画效果
传送门:http://blog.csdn.net/firseve/article/details/50952100
进阶教程<三>TiledMap坐标转换(认识TiledMap的三种地图类型)
传送门:http://blog.csdn.net/z104207/article/details/46873429
进阶教程<四>详细的45度角坐标计算
传送门:http://blog.csdn.net/jianglong0156/article/details/52700551
常用方法汇总:
#CC.TiledMap:*****************************************
~properties:
tmxFile//地图文件
mapLoaded//地图加载是调用的函数
~function:
getMapSize()//
setMapSize()//
getTileSize()//
setTileSize()//
getLayer(name)//returns TieldLayer
getObjectGroup(name)//returns TMXObjectGroup
getPropertiesForGID(GID)//returns Object(属性字典)
#CC.TieldLayer ********************************************
getPositionAt(pos)//returns Vec2(像素坐标) 参数是瓦片坐标
removeTileAt(pos)//瓦片坐标
getTileGIDAt(pos)//returns Number(全局唯一标识,0为空)
getTileAt(pos)//returns _ccsg.Sprite //removeChild(sprite);
setTileGID(gid,pos)//相当于在pos位置添加GID的图块(原来的图块删除)
getTileSize()//
setTleSize()//
getMapTileSize()
#TMXObjectGroup: ******************************************
~properties:
~function:
var getObject(var objectName)//返回属性字典
#_ccsg.Sprite://cocos js 里的Sprite,继承自CC.Node,而不是组件
~properties:
x
y
width
height
opacity
...//节点的属性都有
~function:
var setSpriteFrame(var spriteFrameName)
var runAction(var action)
...//节点的方法都有