SkeletonData 类型
继承于 Asset
模块: sp
Spine 的 骨骼数据。
索引
属性(properties)
skeletonJson
Object
可查看 Spine 官方文档 http://zh.esotericsoftware.com/spine-json-formatatlasText
String
textures
Texture2D[]
textureNames
String[]
scale
Number
可查看 Spine 官方文档: http://zh.esotericsoftware.com/spine-using-runtimes#Scaling_skeletonData
sp.spine.SkeletonData
_atlasCache
sp.spine.Atlas
loaded
Boolean
该资源是否已经成功加载nativeUrl
String
返回该资源对应的目标平台资源的 URL,如果没有将返回一个空字符串。_native
String
Serializable url for native asset._nativeAsset
Object
The underlying native asset of this asset if one is available…._uuid
String
_name
String
_objFlags
Number
name
String
该对象的名称。isValid
Boolean
表示该对象是否可用(被 destroy 后将不可用)。
方法
getRuntimeData
获取 Spine Runtime 使用的 SkeletonData。_getAtlas
toString
Returns the asset's url….serialize
应 AssetDB 要求提供这个方法createNode
使用该资源在场景中创建一个新节点。_setRawAsset
Set native file name for this asset.destroy
销毁该对象,并释放所有它对其它对象的引用。_destruct
Clear all references in the instance…._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
可查看 Spine 官方文档 http://zh.esotericsoftware.com/spine-json-format
meta | description |
---|---|
类型 | Object |
定义于 | extensions/spine/skeleton-data.js:51 |
atlasText
meta | description |
---|---|
类型 | String |
定义于 | extensions/spine/skeleton-data.js:68 |
textures
meta | description |
---|---|
类型 | Texture2D[] |
定义于 | extensions/spine/skeleton-data.js:81 |
textureNames
meta | description |
---|---|
类型 | String[] |
定义于 | extensions/spine/skeleton-data.js:89 |
scale
可查看 Spine 官方文档: http://zh.esotericsoftware.com/spine-using-runtimes#Scaling
meta | description |
---|---|
类型 | Number |
定义于 | extensions/spine/skeleton-data.js:98 |
_skeletonData
meta | description |
---|---|
类型 | sp.spine.SkeletonData |
定义于 | extensions/spine/skeleton-data.js:129 |
_atlasCache
meta | description |
---|---|
类型 | sp.spine.Atlas |
定义于 | extensions/spine/skeleton-data.js:134 |
loaded
该资源是否已经成功加载
meta | description |
---|---|
类型 | Boolean |
定义于 | cocos2d/core/assets/CCAsset.js:57 |
nativeUrl
返回该资源对应的目标平台资源的 URL,如果没有将返回一个空字符串。
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/assets/CCAsset.js:70 |
_native
Serializable url for native asset.
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/assets/CCAsset.js:108 |
_nativeAsset
The underlying native asset of this asset if one is available.This property can be used to access additional details or functionality releated to the asset.This property will be initialized by the loader if_native
is available.
meta | description |
---|---|
类型 | Object |
定义于 | cocos2d/core/assets/CCAsset.js:116 |
_uuid
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/assets/CCRawAsset.js:46 |
_name
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCObject.js:76 |
_objFlags
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCObject.js:83 |
name
该对象的名称。
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCObject.js:243 |
示例
obj.name = "New Obj";
isValid
表示该对象是否可用(被 destroy 后将不可用)。当一个对象的destroy
调用以后,会在这一帧结束后才真正销毁。因此从下一帧开始isValid
就会返回 false,而当前帧内isValid
仍然会是 true。如果希望判断当前帧是否调用过destroy
,请使用cc.isValid(obj, true)
,不过这往往是特殊的业务需求引起的,通常情况下不需要这样。
meta | description |
---|---|
类型 | Boolean |
定义于 | cocos2d/core/platform/CCObject.js:261 |
示例
var node = new cc.Node();
cc.log(node.isValid); // true
node.destroy();
cc.log(node.isValid); // true, still valid in this frame
// after a frame...
cc.log(node.isValid); // false, destroyed in the end of last frame
方法
getRuntimeData
获取 Spine Runtime 使用的 SkeletonData。返回一个 sp.spine.SkeletonData 对象。
meta | description |
---|---|
返回 | sp.spine.SkeletonData |
定义于 | extensions/spine/skeleton-data.js:145 |
参数列表
quiet
Boolean
_getAtlas
meta | description |
---|---|
返回 | sp.spine.Atlas |
定义于 | extensions/spine/skeleton-data.js:233 |
参数列表
quiet
boolean
toString
Returns the asset's url.
The Asset
object overrides the toString()
method of the Object
object.For Asset
objects, the toString() method returns a string representation of the object.JavaScript calls the toString() method automatically when an asset is to be represented as a text value or when a texture is referred to in a string concatenation.
meta | description |
---|---|
返回 | String |
定义于 | cocos2d/core/assets/CCAsset.js:165 |
serialize
应 AssetDB 要求提供这个方法
meta | description |
---|---|
返回 | String |
定义于 | cocos2d/core/assets/CCAsset.js:179 |
createNode
使用该资源在场景中创建一个新节点。如果这类资源没有相应的节点类型,该方法应该是空的。
meta | description |
---|---|
定义于 | cocos2d/core/assets/CCAsset.js:190 |
参数列表
_setRawAsset
Set native file name for this asset.
meta | description |
---|---|
定义于 | cocos2d/core/assets/CCAsset.js:205 |
参数列表
destroy
销毁该对象,并释放所有它对其它对象的引用。实际销毁操作会延迟到当前帧渲染前执行。从下一帧开始,该对象将不再可用。您可以在访问对象之前使用 cc.isValid(obj) 来检查对象是否已被销毁。
meta | description |
---|---|
返回 | Boolean |
定义于 | cocos2d/core/platform/CCObject.js:296 |
示例
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; } } }
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCObject.js:430 |
_onPreDestroy
Called before the object being destroyed.
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCObject.js:463 |
_serialize
The customized serialization for this object. (Editor Only)
meta | description |
---|---|
返回 | object |
定义于 | cocos2d/core/platform/CCObject.js:488 |
参数列表
exporting
Boolean
_deserialize
Init this object from the custom serialized data.
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCObject.js:498 |
参数列表
data
Object the serialized json datactx
_Deserializer