Cocos Creator API

1.5.x

Cocos Creator is the game engine for the future.

TiledMapAsset

Extends Asset
Module: cc

Class for tiled map asset handling.

Properties

rawUrl String readOnly

Inherited from Asset:

Returns the url of this asset's first raw file, if none of rawFile exists, it will returns an empty string.

rawUrls String[] readOnly

Inherited from Asset:

Returns the url of this asset's raw files, if none of rawFile exists, it will returns an empty array.

_rawFiles String[] private

Inherited from Asset:

在 lite 版的 Fireball 里,raw asset 并不仅仅是在 properties 里声明了 rawType 才有, 而是每个 asset 都能指定自己的 raw file url。这些 url 就存在 _rawFiles 字段中。 AssetLibrary 并不会帮你加载这些 url,除非你声明了 rawType。 在 Creator 里,_rawFiles 保留了下来,为了复用 cocos 引擎原有实现,直接用 _rawFiles 来加载 Asset 在 import 之前的源文件。

_uuid String private

Inherited from RawAsset:

_name String private

_objFlags Number private

name String

The name of the object.

examples:

obj.name = "New Obj";

isValid Boolean readOnly

Indicates whether the object is not yet destroyed.

examples:

cc.log(obj.isValid);

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

serialize ( ) String private

Inherited from Asset:

应 AssetDB 要求提供这个方法

returns:

type: String

createNode
(
  • callback
)

Inherited from Asset:

Create a new node using this asset in the scene.
If this type of asset dont have its corresponding node type, this method should be null.

name type description
callback Function
  • error String

    null or the error info

  • node Object

    the created node or null

_setRawFiles
(
  • rawFiles
)
private

Inherited from Asset:

Set raw file names for this asset.

name type description
rawFiles String[]

_preloadRawFiles
(
  • callback
)
private

Inherited from Asset:

Preload raw files when loading scene.

name type description
callback Function

destroy ( ) Boolean

Destroy this Object, and release all its own references to other objects.
Actual object destruction will delayed until before rendering.
After destroy, this CCObject is not usable any more. You can use cc.isValid(obj) to check whether the object is destroyed before accessing it.

returns:

type: Boolean

whether it is the first time the destroy being called

examples:

obj.destroy();

_destruct ( ) private

Clear all references in the instance.

NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject. You can override the _destruct method if you need, for example: _destruct: function () { for (var key in this) { if (this.hasOwnProperty(key)) { switch (typeof this[key]) { case 'string': this[key] = ''; break; case 'object': case 'function': this[key] = null; break; } } }

_onPreDestroy ( ) private

Called before the object being destroyed.

_serialize
(
  • exporting
)
object private

The customized serialization for this object. (Editor Only)

name type description
exporting Boolean

returns:

type: object

the serialized json data object

_deserialize
(
  • data
  • ctx
)
private

Init this object from the custom serialized data.

name type description
data Object

the serialized json data

ctx _Deserializer

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index