This function creates a new runtime skin for skeletal animation sprites through code.
The new skin is created with the name that you provide and takes a list of existing skins in the skeletal animation sprite. The attachments that are linked to these skins are included in the new skin. By combining existing skins in this way you can create custom characters (by grouping attachments).
Creating a skin in this way corresponds visually to pinning a combination of existing skins in the Skins view of the animation tool.
IMPORTANT For skins created using this function you have to pass the struct that it returns to skeleton_skin_set instead of the skin name.
skeleton_skin_create(name, skins);
Argument | Type | Description |
---|---|---|
name | String | The name of the new skin |
skins | Array | An array of names (as String) of existing skins in the skeletal animation sprite that will be used in the new skin. |
var skin = skeleton_skin_create("new_skin", ["hat/red", "shirt/green", "trousers/blue"]);
skeleton_skin_set(skin);
The above code first calls skeleton_skin_create to add a new runtime skin called "new_skin". The skin is created from three existing skins in the skeletal animation sprite: "hat/red", "shirt/green" and "trousers/blue". The result is stored in a temporary variable skin.
It then sets the skin of the skeletal animation sprite of the current instance to this new skin.