Class ccs.Skin

Class Summary
Constructor Attributes Constructor Name and Description
 
ccs.Bone uses ccs.Skin to displays on screen.

Method Summary

Class Detail

ccs.Skin()
ccs.Bone uses ccs.Skin to displays on screen.

Field Detail

{ccs.Bone} bone
- The bone of the skin
{String} displayName
- <@readonly> The displayed name of skin
{Object} skinData
- The data of the skin

Method Detail

  • <static> {ccs.Skin} ccs.Skin.create(fileName, rect)
    allocates and initializes a skin.
    // example
    var skin = ccs.Skin.create("res/test.png",cc.rect(0,0,50,50));
    var skin = ccs.Skin.create("#test.png");             //=> ccs.Skin.createWithSpriteFrameName("test.png");
    Parameters:
    {String} fileName Optional
    fileName or sprite frame name
    {cc.Rect} rect Optional
    Returns:
    {ccs.Skin}
  • <static> {ccs.Skin} ccs.Skin.createWithSpriteFrameName(spriteFrameName)
    allocates and initializes a skin.
    // example
    var skin = ccs.Skin.createWithSpriteFrameName("test.png");
    Parameters:
    {String} spriteFrameName
    Returns:
    {ccs.Skin}
  • ctor()
    Construction of ccs.Skin.
  • {null} getBone()
    Returns the bone reference of ccs.Skin.
    Returns:
    {null}
  • {String} getDisplayName()
    display name getter
    Returns:
    {String}
  • {cc.AffineTransform} getNodeToWorldTransform()
    Returns skin's world transform.
    Returns:
    {cc.AffineTransform}
  • {ccs.BaseData} getSkinData()
    Returns skin date of ccs.Skin.
    Returns:
    {ccs.BaseData}
  • {Boolean} initWithFile(fileName)
    Initializes with texture file name.
    Parameters:
    {String} fileName
    Returns:
    {Boolean}
  • {Boolean} initWithSpriteFrameName(spriteFrameName)
    Initializes with sprite frame name
    Parameters:
    {String} spriteFrameName
    Returns:
    {Boolean}
  • setBone(bone)
    Sets the bone reference to ccs.Skin.
    Parameters:
    bone
  • setSkinData(skinData)
    Sets skin data to ccs.Skin.
    Parameters:
    {ccs.BaseData} skinData
  • updateArmatureTransform()
    Updates armature skin's transform with skin transform and bone's transform.