SkeletonData
Class
Extends Asset
Module: sp
The skeleton data of spine.
Index
Properties
skeletonJson
Object
See http://en.esotericsoftware.com/spine-json-format
atlasText
String
textures
Texture2D[]
scale
Number
A scale can be specified on the JSON or binary loader which will scale the bone positions,
image sizes, and animation translations.
This can be useful when using different sized images than were used when designing the skeleton
in Spine. For example, if using images that are half the size than were used in Spine,
a scale of 0.5 can be used. This is commonly used for games that can run with either low or high
resolution texture atlases.
see http://en.esotericsoftware.com/spine-using-runtimes#Scaling
_skeletonData
sp.spine.SkeletonData
_atlasCache
sp.spine.Atlas
rawUrl
String
Returns the url of this asset's first raw file, if none of rawFile exists,
it will returns an empty string.
rawUrls
String[]
Returns the url of this asset's raw files, if none of rawFile exists,
it will returns an empty array.
_rawFiles
String[]
在 lite 版的 Fireball 里,raw asset 并不仅仅是在 properties 里声明了 rawType 才有,
而是每个 asset 都能指定自己的 raw file url。这些 url 就存在 _rawFiles 字段中。
AssetLibrary 并不会帮你加载这些 url,除非你声明了 rawType。
在 Creator 里,_rawFiles 保留了下来,为了复用 cocos 引擎原有实现,直接用 _rawFiles 来加载 Asset 在 import 之前的源文件。
_uuid
String
_name
String
_objFlags
Number
name
String
The name of the object.
isValid
Boolean
Indicates whether the object is not yet destroyed.
Methods
getRuntimeData
Get the included SkeletonData used in spine runtime.
Returns a sp.spine.SkeletonData object.
_getAtlas
serialize
应 AssetDB 要求提供这个方法
createNode
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.
_setRawFiles
Set raw file names for this asset.
_preloadRawFiles
Preload raw files when loading scene.
destroy
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.
_destruct
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
Called before the object being destroyed.
_serialize
The customized serialization for this object. (Editor Only)
_deserialize
Init this object from the custom serialized data.
Details
Properties
skeletonJson
See http://en.esotericsoftware.com/spine-json-format
atlasText
textures
scale
A scale can be specified on the JSON or binary loader which will scale the bone positions,
image sizes, and animation translations.
This can be useful when using different sized images than were used when designing the skeleton
in Spine. For example, if using images that are half the size than were used in Spine,
a scale of 0.5 can be used. This is commonly used for games that can run with either low or high
resolution texture atlases.
see http://en.esotericsoftware.com/spine-using-runtimes#Scaling
_skeletonData
_atlasCache
rawUrl
Returns the url of this asset's first raw file, if none of rawFile exists,
it will returns an empty string.
rawUrls
Returns the url of this asset's raw files, if none of rawFile exists,
it will returns an empty array.
_rawFiles
在 lite 版的 Fireball 里,raw asset 并不仅仅是在 properties 里声明了 rawType 才有,
而是每个 asset 都能指定自己的 raw file url。这些 url 就存在 _rawFiles 字段中。
AssetLibrary 并不会帮你加载这些 url,除非你声明了 rawType。
在 Creator 里,_rawFiles 保留了下来,为了复用 cocos 引擎原有实现,直接用 _rawFiles 来加载 Asset 在 import 之前的源文件。
_uuid
_name
_objFlags
name
The name of the object.
Examples
obj.name = "New Obj";
isValid
Indicates whether the object is not yet destroyed.
Examples
cc.log(obj.isValid);
Methods
getRuntimeData
Get the included SkeletonData used in spine runtime.
Returns a sp.spine.SkeletonData object.
Parameters
_getAtlas
Parameters
serialize
应 AssetDB 要求提供这个方法
createNode
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.
Parameters
_setRawFiles
Set raw file names for this asset.
Parameters
_preloadRawFiles
Preload raw files when loading scene.
Parameters
destroy
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.
Examples
obj.destroy();
_destruct
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
Called before the object being destroyed.
_serialize
The customized serialization for this object. (Editor Only)
Parameters
_deserialize
Init this object from the custom serialized data.
Parameters
data
Object the serialized json data
ctx
_Deserializer