From ff4584ebdc3cb6d4a2a7a2586ae6a2c76dc86499 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 17 Feb 2016 18:13:25 +0800 Subject: [PATCH 1/3] Implement the component TMXTiledMap. --- cocos2d/core/assets/CCTiledMapAsset.js | 32 --- cocos2d/core/components/CCTMXTiledMap.js | 234 ++++++++++++++++++ cocos2d/core/components/index.js | 3 +- .../{CCTMXTiledMap.js => CCSGTMXTiledMap.js} | 35 +-- gulp/tasks/build-cocos2d.js | 2 +- jsb/jsb-etc.js | 3 +- 6 files changed, 257 insertions(+), 52 deletions(-) create mode 100644 cocos2d/core/components/CCTMXTiledMap.js rename cocos2d/tilemap/{CCTMXTiledMap.js => CCSGTMXTiledMap.js} (92%) diff --git a/cocos2d/core/assets/CCTiledMapAsset.js b/cocos2d/core/assets/CCTiledMapAsset.js index 652d139261..68964946d0 100644 --- a/cocos2d/core/assets/CCTiledMapAsset.js +++ b/cocos2d/core/assets/CCTiledMapAsset.js @@ -7,38 +7,6 @@ var TiledMapAsset = cc.Class({ name: 'cc.TiledMapAsset', extends: cc.RawAsset, - - statics: { - createNodeByInfo: function (info, callback) { - if (CC_EDITOR) { - - var Url = require('fire-url'); - - cc.TiledMapWrapper.preloadTmx( info.url , function (err, textures) { - if (err) { - callback(err); - return; - } - - var node; - try { - node = new cc.TMXTiledMap(info.url); - node._file = info.url; - } - catch(e) { - return callback(e); - } - - var wrapper = cc.getWrapper(node); - wrapper.name = Url.basenameNoExt(info.url); - wrapper._textures = textures; - - return callback(null, node); - }.bind(this) ); - - } - } - } }); cc.TiledMapAsset = TiledMapAsset; diff --git a/cocos2d/core/components/CCTMXTiledMap.js b/cocos2d/core/components/CCTMXTiledMap.js new file mode 100644 index 0000000000..a459217fc9 --- /dev/null +++ b/cocos2d/core/components/CCTMXTiledMap.js @@ -0,0 +1,234 @@ +/**************************************************************************** + Copyright (c) 2016 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + 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. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +/** + * Renders a TMX Tile Map in the scene. + * @class TMXTiledMap + * @extends _ComponentInSG + */ +var TMXTiledMap = cc.Class({ + name: 'cc.TMXTiledMap', + extends: require('./CCComponentInSG'), + + editor: CC_EDITOR && { + menu: 'i18n:MAIN_MENU.component.renderers/TileMap' + }, + + properties: { + _tmxFile: { + default: '', + url: cc.TiledMapAsset + }, + + tmxFile : { + get: function () { + return this._tmxFile; + }, + set: function (value, force) { + if (this._tmxFile !== value || (CC_EDITOR && force)) { + this._tmxFile = value; + this._applyFile(); + } + }, + url: cc.TiledMapAsset + } + }, + + /** + * Gets the map size. + * @return {cc.Size} + */ + getMapSize:function () { + return this._sgNode.getMapSize(); + }, + + /** + * Set the map size. + * @param {cc.Size} Var + */ + setMapSize:function (Var) { + this._sgNode.setMapSize(Var); + }, + + /** + * Gets the tile size. + * @return {cc.Size} + */ + getTileSize:function () { + return this._sgNode.getTileSize(); + }, + + /** + * Set the tile size + * @param {cc.Size} Var + */ + setTileSize:function (Var) { + this._sgNode.setTileSize(Var); + }, + + /** + * map orientation + * @return {Number} + */ + getMapOrientation:function () { + return this._sgNode.getMapOrientation(); + }, + + /** + * map orientation + * @param {Number} Var + */ + setMapOrientation:function (Var) { + this._sgNode.setMapOrientation(Var); + }, + + /** + * object groups + * @return {Array} + */ + getObjectGroups:function () { + return this._sgNode.getObjectGroups(); + }, + + /** + * object groups + * @param {Array} Var + */ + setObjectGroups:function (Var) { + this._sgNode.setObjectGroups(Var); + }, + + /** + * Gets the map properties + * @return {object} + */ + getProperties:function () { + return this._sgNode.getProperties(); + }, + + /** + * Set the map properties + * @param {object} Var + */ + setProperties:function (Var) { + this._sgNode.setProperties(Var); + }, + + /** + * Initializes the instance of cc.TMXTiledMap with tmxFile + * @param {String} tmxFile + * @return {Boolean} Whether the initialization was successful. + */ + initWithTMXFile:function (tmxFile) { + return this._sgNode.initWithTMXFile(tmxFile); + }, + + /** + * Initializes the instance of cc.TMXTiledMap with tmxString + * @param {String} tmxString + * @param {String} resourcePath + * @return {Boolean} Whether the initialization was successful. + */ + initWithXML:function(tmxString, resourcePath){ + return this._sgNode.initWithXML(tmxString, resourcePath); + }, + + /** + * Return All layers array. + * @returns {Array} + */ + allLayers: function () { + return this._sgNode.allLayers(); + }, + + /** + * return the TMXLayer for the specific layer + * @param {String} layerName + * @return {cc.TMXLayer} + */ + getLayer:function (layerName) { + return this._sgNode.getLayer(layerName); + }, + + /** + * Return the TMXObjectGroup for the specific group + * @param {String} groupName + * @return {cc.TMXObjectGroup} + */ + getObjectGroup:function (groupName) { + return this._sgNode.getObjectGroup(groupName); + }, + + /** + * Return the value for the specific property name + * @param {String} propertyName + * @return {String} + */ + getProperty:function (propertyName) { + return this._sgNode.getProperty(propertyName); + }, + + /** + * Return properties dictionary for tile GID + * @param {Number} GID + * @return {object} + */ + getPropertiesForGID: function(GID) { + return this._sgNode.getPropertiesForGID(GID); + }, + + onEnable: function () { + if (this._sgNode && this._tmxFile) { + this._sgNode.setVisible(true); + } + }, + + _applyFile: function () { + var sgNode = this._sgNode; + var file = this._tmxFile; + var self = this; + if (file) { + cc.loader.load(file, function (err, results) { + if (err) throw err; + + sgNode.initWithTMXFile(file); + if (self.enabledInHierarchy && !sgNode.isVisible()) { + sgNode.setVisible(true); + } + }); + } else { + sgNode.setVisible(false); + } + }, + + _createSgNode: function () { + return new _ccsg.TMXTiledMap(); + }, + + _initSgNode: function () { + this._applyFile(); + } +}); + +cc.TMXTiledMap = module.exports = TMXTiledMap; diff --git a/cocos2d/core/components/index.js b/cocos2d/core/components/index.js index a8634b8cb6..377abc181e 100644 --- a/cocos2d/core/components/index.js +++ b/cocos2d/core/components/index.js @@ -1,6 +1,6 @@ require('./CCComponent'); require('./CCComponentInSG'); -require('./CCComponentEventHandler') +require('./CCComponentEventHandler'); module.exports = [ require('./CCSprite'), @@ -16,4 +16,5 @@ module.exports = [ require('./CCScrollView'), require('./CCLayout'), require('./CCEditBox'), + require('./CCTMXTiledMap'), ]; diff --git a/cocos2d/tilemap/CCTMXTiledMap.js b/cocos2d/tilemap/CCSGTMXTiledMap.js similarity index 92% rename from cocos2d/tilemap/CCTMXTiledMap.js rename to cocos2d/tilemap/CCSGTMXTiledMap.js index de39af7d61..be7208684d 100644 --- a/cocos2d/tilemap/CCTMXTiledMap.js +++ b/cocos2d/tilemap/CCSGTMXTiledMap.js @@ -121,7 +121,7 @@ cc.TMX_ORIENTATION_ISO = 2; * var xmlStr = cc.loader.getRes(filePath); * var tmxTiledMap = new cc.TMXTiledMap(xmlStr, resources); */ -cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ +_ccsg.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ properties: null, mapOrientation: null, objectGroups: null, @@ -135,7 +135,7 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ /** * Creates a TMX Tiled Map with a TMX file or content string.
- * Constructor of cc.TMXTiledMap + * Constructor of _ccsg.TMXTiledMap * @param {String} tmxFile tmxFile fileName or content string * @param {String} resourcePath If tmxFile is a file name ,it is not required.If tmxFile is content string ,it is must required. */ @@ -260,17 +260,18 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ }, /** - * Initializes the instance of cc.TMXTiledMap with tmxFile + * Initializes the instance of _ccsg.TMXTiledMap with tmxFile * @param {String} tmxFile * @return {Boolean} Whether the initialization was successful. * @example * //example - * var map = new cc.TMXTiledMap() + * var map = new _ccsg.TMXTiledMap() * map.initWithTMXFile("hello.tmx"); */ initWithTMXFile:function (tmxFile) { - if(!tmxFile || tmxFile.length === 0) - throw new Error("cc.TMXTiledMap.initWithTMXFile(): tmxFile should be non-null or non-empty string."); + if(!tmxFile || tmxFile.length === 0) { + return false; + } this.width = 0; this.height = 0; var mapInfo = new cc.TMXMapInfo(tmxFile); @@ -279,13 +280,13 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ var locTilesets = mapInfo.getTilesets(); if(!locTilesets || locTilesets.length === 0) - cc.log("cc.TMXTiledMap.initWithTMXFile(): Map not found. Please check the filename."); + cc.log("_ccsg.TMXTiledMap.initWithTMXFile(): Map not found. Please check the filename."); this._buildWithMapInfo(mapInfo); return true; }, /** - * Initializes the instance of cc.TMXTiledMap with tmxString + * Initializes the instance of _ccsg.TMXTiledMap with tmxString * @param {String} tmxString * @param {String} resourcePath * @return {Boolean} Whether the initialization was successful. @@ -297,7 +298,7 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ var mapInfo = new cc.TMXMapInfo(tmxString, resourcePath); var locTilesets = mapInfo.getTilesets(); if(!locTilesets || locTilesets.length === 0) - cc.log("cc.TMXTiledMap.initWithXML(): Map not found. Please check the filename."); + cc.log("_ccsg.TMXTiledMap.initWithXML(): Map not found. Please check the filename."); this._buildWithMapInfo(mapInfo); return true; }, @@ -349,7 +350,7 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ */ getLayer:function (layerName) { if(!layerName || layerName.length === 0) - throw new Error("cc.TMXTiledMap.getLayer(): layerName should be non-null or non-empty string."); + throw new Error("_ccsg.TMXTiledMap.getLayer(): layerName should be non-null or non-empty string."); var locChildren = this._children; for (var i = 0; i < locChildren.length; i++) { var layer = locChildren[i]; @@ -367,7 +368,7 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ */ getObjectGroup:function (groupName) { if(!groupName || groupName.length === 0) - throw new Error("cc.TMXTiledMap.getObjectGroup(): groupName should be non-null or non-empty string."); + throw new Error("_ccsg.TMXTiledMap.getObjectGroup(): groupName should be non-null or non-empty string."); if (this.objectGroups) { for (var i = 0; i < this.objectGroups.length; i++) { var objectGroup = this.objectGroups[i]; @@ -449,7 +450,7 @@ cc.TMXTiledMap = _ccsg.Node.extend(/** @lends cc.TMXTiledMap# */{ } }); -var _p = cc.TMXTiledMap.prototype; +var _p = _ccsg.TMXTiledMap.prototype; // Extended properties /** @expose */ @@ -468,12 +469,12 @@ cc.defineGetterSetter(_p, "tileHeight", _p._getTileHeight, _p._setTileHeight); /** * Creates a TMX Tiled Map with a TMX file or content string. - * Implementation cc.TMXTiledMap - * @deprecated since v3.0 please use new cc.TMXTiledMap(tmxFile,resourcePath) instead. + * Implementation _ccsg.TMXTiledMap + * @deprecated since v3.0 please use new _ccsg.TMXTiledMap(tmxFile,resourcePath) instead. * @param {String} tmxFile tmxFile fileName or content string * @param {String} resourcePath If tmxFile is a file name ,it is not required.If tmxFile is content string ,it is must required. - * @return {cc.TMXTiledMap|undefined} + * @return {_ccsg.TMXTiledMap|undefined} */ -cc.TMXTiledMap.create = function (tmxFile,resourcePath) { - return new cc.TMXTiledMap(tmxFile,resourcePath); +_ccsg.TMXTiledMap.create = function (tmxFile,resourcePath) { + return new _ccsg.TMXTiledMap(tmxFile,resourcePath); }; diff --git a/gulp/tasks/build-cocos2d.js b/gulp/tasks/build-cocos2d.js index c3e8fa477a..e7d4bba4d5 100644 --- a/gulp/tasks/build-cocos2d.js +++ b/gulp/tasks/build-cocos2d.js @@ -134,7 +134,7 @@ var srcs = [ './cocos2d/menus/CCMenu.js', './cocos2d/tilemap/CCTGAlib.js', - './cocos2d/tilemap/CCTMXTiledMap.js', + './cocos2d/tilemap/CCSGTMXTiledMap.js', './cocos2d/tilemap/CCTMXXMLParser.js', './cocos2d/tilemap/CCTMXObjectGroup.js', './cocos2d/tilemap/CCTMXLayer.js', diff --git a/jsb/jsb-etc.js b/jsb/jsb-etc.js index a63c5e5439..daa0a6c575 100644 --- a/jsb/jsb-etc.js +++ b/jsb/jsb-etc.js @@ -262,7 +262,8 @@ window._ccsg = { Sprite: cc.Sprite, ParticleSystem: cc.ParticleSystem, Label: cc.Label, - EditBox: cc.EditBox + EditBox: cc.EditBox, + TMXTiledMap: cc.TMXTiledMap }; // rename cc.Class to cc._Class From c8c1c649e4b30c8216e40409fe9b8ab5a568db8c Mon Sep 17 00:00:00 2001 From: zhangbin Date: Fri, 19 Feb 2016 09:31:57 +0800 Subject: [PATCH 2/3] Preload texture files when importing tmx file. --- cocos2d/core/components/CCTMXTiledMap.js | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/components/CCTMXTiledMap.js b/cocos2d/core/components/CCTMXTiledMap.js index a459217fc9..ec0d09b13f 100644 --- a/cocos2d/core/components/CCTMXTiledMap.js +++ b/cocos2d/core/components/CCTMXTiledMap.js @@ -204,12 +204,37 @@ var TMXTiledMap = cc.Class({ } }, + _preloadTmx: function(file, cb) { + cc.loader.load(file, function (err) { + if (err) { + if (cb) cb(err); + return; + } + + var mapInfo = new cc.TMXMapInfo(file); + var sets = mapInfo.getTilesets(); + + if (sets) { + var textures = sets.map(function (set) { + return set.sourceImage; + }); + + cc.loader.load(textures, function (err) { + cb(err, textures); + }); + } + else { + if (cb) cb(); + } + }); + }, + _applyFile: function () { var sgNode = this._sgNode; var file = this._tmxFile; var self = this; if (file) { - cc.loader.load(file, function (err, results) { + this._preloadTmx(file, function (err, results) { if (err) throw err; sgNode.initWithTMXFile(file); From f649a502276c54c85659a7b2c84972123198d2a8 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Fri, 19 Feb 2016 12:06:47 +0800 Subject: [PATCH 3/3] Optimize the implementation of TiledMap component. 1. Keep the TiledMap component related files in folder `engine/cocos2d/tilemap` 2. Add comments in file CCTiledMap.js --- cocos2d/core/assets/index.js | 1 - cocos2d/core/components/index.js | 1 - .../CCTiledMap.js} | 38 ++++++++++++++---- .../assets => tilemap}/CCTiledMapAsset.js | 0 cocos2d/tilemap/editor/tiled-map.js | 13 ++++++ cocos2d/tilemap/editor/tiled-map.png | Bin 0 -> 3488 bytes extends.js | 3 ++ 7 files changed, 46 insertions(+), 10 deletions(-) rename cocos2d/{core/components/CCTMXTiledMap.js => tilemap/CCTiledMap.js} (87%) rename cocos2d/{core/assets => tilemap}/CCTiledMapAsset.js (100%) create mode 100644 cocos2d/tilemap/editor/tiled-map.js create mode 100644 cocos2d/tilemap/editor/tiled-map.png diff --git a/cocos2d/core/assets/index.js b/cocos2d/core/assets/index.js index eabb918735..7ef40af9a5 100644 --- a/cocos2d/core/assets/index.js +++ b/cocos2d/core/assets/index.js @@ -37,4 +37,3 @@ require('../textures/CCTexture2D'); require('./CCTTFFont'); require('./CCSpriteAnimation'); require('./CCSpriteAtlas'); -require('./CCTiledMapAsset'); diff --git a/cocos2d/core/components/index.js b/cocos2d/core/components/index.js index 377abc181e..ee5d42f4cc 100644 --- a/cocos2d/core/components/index.js +++ b/cocos2d/core/components/index.js @@ -16,5 +16,4 @@ module.exports = [ require('./CCScrollView'), require('./CCLayout'), require('./CCEditBox'), - require('./CCTMXTiledMap'), ]; diff --git a/cocos2d/core/components/CCTMXTiledMap.js b/cocos2d/tilemap/CCTiledMap.js similarity index 87% rename from cocos2d/core/components/CCTMXTiledMap.js rename to cocos2d/tilemap/CCTiledMap.js index ec0d09b13f..bc7b7e467d 100644 --- a/cocos2d/core/components/CCTMXTiledMap.js +++ b/cocos2d/tilemap/CCTiledMap.js @@ -24,18 +24,23 @@ /** * Renders a TMX Tile Map in the scene. - * @class TMXTiledMap + * @class TiledMap * @extends _ComponentInSG */ -var TMXTiledMap = cc.Class({ - name: 'cc.TMXTiledMap', - extends: require('./CCComponentInSG'), +var TiledMap = cc.Class({ + name: 'cc.TiledMap', + extends: require('./../core/components/CCComponentInSG'), editor: CC_EDITOR && { - menu: 'i18n:MAIN_MENU.component.renderers/TileMap' + menu: 'i18n:MAIN_MENU.component.renderers/TiledMap' }, properties: { + /** + * The tmx file. + * @property {string} file + * @default "" + */ _tmxFile: { default: '', url: cc.TiledMapAsset @@ -57,6 +62,7 @@ var TMXTiledMap = cc.Class({ /** * Gets the map size. + * @method getMapSize * @return {cc.Size} */ getMapSize:function () { @@ -65,6 +71,7 @@ var TMXTiledMap = cc.Class({ /** * Set the map size. + * @method setMapSize * @param {cc.Size} Var */ setMapSize:function (Var) { @@ -73,6 +80,7 @@ var TMXTiledMap = cc.Class({ /** * Gets the tile size. + * @method getTileSize * @return {cc.Size} */ getTileSize:function () { @@ -81,6 +89,7 @@ var TMXTiledMap = cc.Class({ /** * Set the tile size + * @method setTileSize * @param {cc.Size} Var */ setTileSize:function (Var) { @@ -89,6 +98,7 @@ var TMXTiledMap = cc.Class({ /** * map orientation + * @method getMapOrientation * @return {Number} */ getMapOrientation:function () { @@ -97,6 +107,7 @@ var TMXTiledMap = cc.Class({ /** * map orientation + * @method setMapOrientation * @param {Number} Var */ setMapOrientation:function (Var) { @@ -105,6 +116,7 @@ var TMXTiledMap = cc.Class({ /** * object groups + * @method getObjectGroups * @return {Array} */ getObjectGroups:function () { @@ -113,6 +125,7 @@ var TMXTiledMap = cc.Class({ /** * object groups + * @method setObjectGroups * @param {Array} Var */ setObjectGroups:function (Var) { @@ -121,6 +134,7 @@ var TMXTiledMap = cc.Class({ /** * Gets the map properties + * @method getProperties * @return {object} */ getProperties:function () { @@ -129,6 +143,7 @@ var TMXTiledMap = cc.Class({ /** * Set the map properties + * @method setProperties * @param {object} Var */ setProperties:function (Var) { @@ -136,7 +151,8 @@ var TMXTiledMap = cc.Class({ }, /** - * Initializes the instance of cc.TMXTiledMap with tmxFile + * Initializes the instance of cc.TiledMap with tmxFile + * @method initWithTMXFile * @param {String} tmxFile * @return {Boolean} Whether the initialization was successful. */ @@ -145,7 +161,8 @@ var TMXTiledMap = cc.Class({ }, /** - * Initializes the instance of cc.TMXTiledMap with tmxString + * Initializes the instance of cc.TiledMap with tmxString + * @method initWithXML * @param {String} tmxString * @param {String} resourcePath * @return {Boolean} Whether the initialization was successful. @@ -156,6 +173,7 @@ var TMXTiledMap = cc.Class({ /** * Return All layers array. + * @method allLayers * @returns {Array} */ allLayers: function () { @@ -164,6 +182,7 @@ var TMXTiledMap = cc.Class({ /** * return the TMXLayer for the specific layer + * @method getLayer * @param {String} layerName * @return {cc.TMXLayer} */ @@ -173,6 +192,7 @@ var TMXTiledMap = cc.Class({ /** * Return the TMXObjectGroup for the specific group + * @method getObjectGroup * @param {String} groupName * @return {cc.TMXObjectGroup} */ @@ -182,6 +202,7 @@ var TMXTiledMap = cc.Class({ /** * Return the value for the specific property name + * @method getProperty * @param {String} propertyName * @return {String} */ @@ -191,6 +212,7 @@ var TMXTiledMap = cc.Class({ /** * Return properties dictionary for tile GID + * @method getPropertiesForGID * @param {Number} GID * @return {object} */ @@ -256,4 +278,4 @@ var TMXTiledMap = cc.Class({ } }); -cc.TMXTiledMap = module.exports = TMXTiledMap; +cc.TiledMap = module.exports = TiledMap; diff --git a/cocos2d/core/assets/CCTiledMapAsset.js b/cocos2d/tilemap/CCTiledMapAsset.js similarity index 100% rename from cocos2d/core/assets/CCTiledMapAsset.js rename to cocos2d/tilemap/CCTiledMapAsset.js diff --git a/cocos2d/tilemap/editor/tiled-map.js b/cocos2d/tilemap/editor/tiled-map.js new file mode 100644 index 0000000000..0b89b88d4f --- /dev/null +++ b/cocos2d/tilemap/editor/tiled-map.js @@ -0,0 +1,13 @@ +'use strict'; + +class TiledMapMeta extends Editor.metas['raw-asset'] { + constructor ( assetdb ) { + super( assetdb ); + } + + static defaultType() { return 'tiled-map'; } +} + +TiledMapMeta.prototype.export = null; + +module.exports = TiledMapMeta; diff --git a/cocos2d/tilemap/editor/tiled-map.png b/cocos2d/tilemap/editor/tiled-map.png new file mode 100644 index 0000000000000000000000000000000000000000..27795f4765dc451eebcb2ef0712c3423fb56232a GIT binary patch literal 3488 zcmV;R4PWw!P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ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