skeleton_skin_list(sprite, list);
Argument | Description |
---|---|
sprite | The sprite index of the Spine skeletal animation to get the list from. |
list | The ID of the DS list to populate with the animation names. |
Returns: N/A
With this function you can populate a (pre-created) ds_list with all the names of the skins included as part of the skeletal animation sprite. The names will be strings and can then be used in the other skeleton animation skin functions for these types of sprite.
IMPORTANT: Spine integration in GameMaker: Studio is a Pro licence feature and will not work in the Free/Standard versions.
var list = ds_list_create();
skeleton_skin_list(sprite_index, list);
var num = ds_list_size(list);
skeleton_skin_set(list[| irandom(num - 1));
ds_list_destroy(list);
The above code creates a DS list then populates it with the skin names. A random one is then chosen and applied to the instance before the list is destroyed.