Argument Description bone The name (as a string) of the bone. map The (previously created) ds_map that stores the bone data.
Your skeletal animation is made up of a number of "bones", which you will have defined and given names to in your animation program. This function can be used to get information on the named bone at any time and store the data in an empty ds_map, which you must have created previously. Note that this data refers to the default pose for the skeleton, and not the current pose that is being drawn. If you need the data from the current pose, use skeleton_bone_state_get.
When you call this function the map will be populated with the following keys:
- "x": The local x position of the bone relative to the parent bone.
- "y": The local y position of the bone relative to the parent bone.
- "angle": The local rotation of the bone relative to the parent bone.
- "xscale": The local horizontal scale of the bone, in reference to the parent bone.
- "yscale": The local vertical scale of the bone, in reference to the parent bone.
- "parent": The name (a string) of the parent bone.
IMPORTANT! This function is not available with the Trial Licence of the product.
bone_map = ds_map_create();
The above code creates a ds_map and then populates it with the data from the bone named "leftarm".