Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

Skeleton

Module: sp

The skeleton of Spine

(Skeleton has a reference to a SkeletonData and stores the state for skeleton instance, which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible.
Multiple skeletons can use the same SkeletonData which includes all animations, skins, and attachments.)

Properties

paused Boolean readOnly

The skeletal animation is paused?

skeletonData SkeletonData

The skeleton data contains the skeleton information (bind pose bones, slots, draw order, attachments, skins, etc) and animations but does not hold any state.
Multiple skeletons can share the same skeleton data.

defaultSkin String

The name of default skin.

defaultAnimation String

The name of default animation.

animation String

The name of current playing animation.

_defaultSkinIndex Number

loop Boolean

TODO

premultipliedAlpha Boolean

Indicates whether to enable premultiplied alpha. You should disable this option when image's transparent area appears to have opaque pixels, or enable this option when image's half transparent area appears to be darken.

timeScale Number

The time scale of this skeleton.

debugSlots Boolean

Indicates whether open debug slots.

debugBones Boolean

Indicates whether open debug bones.

_sgNode _ccsg.Node private

Reference to the instance of _ccsg.Node If it is possible to return null from your overloaded _createSgNode, then you should always check for null before using this property and reimplement __preload.

__eventTargets Array private

Inherited from Component:

Register all related EventTargets, all event callbacks will be removed in _onPreDestroy

node Node

Inherited from Component:

The node this component is attached to. A component is always attached to a node.

examples:

cc.log(comp.node);

uuid String readOnly

Inherited from Component:

The uuid for editor.

examples:

cc.log(comp.uuid);

_enabled Boolean private

Inherited from Component:

enabled Boolean

Inherited from Component:

indicates whether this component is enabled or not.

examples:

comp.enabled = true;
cc.log(comp.enabled);

enabledInHierarchy Boolean readOnly

Inherited from Component:

indicates whether this component is enabled and its node is also active in the hierarchy.

examples:

cc.log(comp.enabledInHierarchy);

_isOnLoadCalled Boolean readOnly

Inherited from Component:

TODO

examples:

cc.log(_isOnLoadCalled);

_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

updateWorldTransform ( )

Computes the world SRT from the local SRT for each bone.

examples:

var bone = spine.findBone('head');
cc.log(bone.worldX); // return 0;
spine.updateWorldTransform();
bone = spine.findBone('head');
cc.log(bone.worldX); // return -23.12;

setToSetupPose ( )

Sets the bones and slots to the setup pose.

setBonesToSetupPose ( )

Sets the bones to the setup pose, using the values from the BoneData list in the SkeletonData.

setSlotsToSetupPose ( )

Sets the slots to the setup pose, using the values from the SlotData list in the SkeletonData.

findBone
(
  • boneName
)
sp.spine.Bone