Class cc.TMXMapInfo#ctor

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.TMXMapInfo#ctor(tmxFile, resourcePath)
Creates a TMX Format with a tmx file or content string

Class Detail

cc.TMXMapInfo#ctor(tmxFile, resourcePath)
Creates a TMX Format with a tmx file or content string
1.
//create a TMXMapInfo with file name
var tmxMapInfo = cc.TMXMapInfo.create("res/orthogonal-test1.tmx");
2.
//create a TMXMapInfo with content string and resource path
var resources = "res/TileMaps";
var filePath = "res/TileMaps/orthogonal-test1.tmx";
var xmlStr = cc.loader.getRes(filePath);
var tmxMapInfo = cc.TMXMapInfo.create(xmlStr, resources);
Parameters:
{String} tmxFile
fileName or content string
{String} resourcePath
If tmxFile is a file name ,it is not required.If tmxFile is content string ,it is must required.