-
Notifications
You must be signed in to change notification settings - Fork 2
Library Documentation
This page features on-line documentation for all public Disarm functions.
Uses a set of events to request information that is used to build a Disarm instance. The events
struct must contain the fields armature
, atlas
, and image
. Each of these fields must store a function which will return the struct or the file path of where the data is stored externally.
Name | Type | Description |
---|---|---|
events | struct | A struct containing the events to call in order to load the armature, atlas, and image files |
Returns: struct
Attempts to import a Spriter project as a Disarm instance by using a virtual file system.
Name | Type | Description |
---|---|---|
arm | value | The string or struct containing armature data |
atlas_map (optional) | struct | A map from atlas names to atlas data |
image_map (optional) | struct | A map from image names to image data |
Returns: struct
Attempts to import a Spriter project as a Disarm instance. If the atlas files are imported as sprites, the image_map
struct can be used to map from image filenames to their resource names.
Name | Type | Description |
---|---|---|
path | string | The file path of the skeleton file |
image_map (optional) | struct | A map from image names to image data |
Returns: struct
Collects any dynamically allocated sprites that are no longer referenced.
Returns: N/A
Returns whether an atlas exists with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
atlas_name_or_id | value | The name of the atlas to check |
Returns: real
Returns a reference to the atlas data with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
atlas_name_or_id | value | The name of the atlas to get |
Returns: struct
Note: any changes made to this struct will affect the representation of the atlas in the animation.
Returns whether an entity exists with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
entity_name_or_id | value | The name of the entity to check |
Returns: real
Returns a reference to the entity data with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
entity_name_or_id | value | The name of the entity to get |
Returns: struct
Note: any changes made to this struct will affect the representation of the entity in the animation.
Sets the entity with this name as the current for this armature.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
entity_name_or_id | real | The name of the entity to set |
Returns: N/A
Returns whether a character map exists with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
skin_name_or_id | real | The name of the skin to check |
Returns: real
Returns a reference to the skin data with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
skin_name_or_id | real | The name of the skin to get |
Returns: struct
Note: any changes made to this struct will affect the representation of the skin in the animation.
Clears the current character map state.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
Returns: N/A
Adds a new character map, or array of character maps, to the current active skin.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
skin_name_or_id | value | The name, or array of names, of skins to add |
Returns: N/A
Returns a copy of the current skin.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
Returns: struct
Overrites the current skin with a copy of a stashed skin.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
skin_data | struct | The skin to apply |
Returns: N/A
Returns whether an object exists with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
object_name_or_id | value | The name of the object to check |
Returns: real
Returns a reference to the object data with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
object_name_or_id | value | The name of the object to get |
Returns: struct
Note: any changes made to this struct will affect the representation of the object in the animation.
Returns whether a slot exists with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
slot_name_or_id | value | The name of the slot to check |
Returns: real
Returns a reference to the slot data with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
slot_name_or_id | value | The name of the slot to get |
Returns: struct
Note: any changes made to this struct will affect the representation of the slot in the animation.
Returns whether an animation exists with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
anim_name_or_id | value | The name of the animation to check |
Returns: real
Returns a reference to the animation data with this name.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
anim_name_or_id | value | The name of the animation to get |
Returns: real
Note: any changes made to this struct will affect the representation of the animation.
Resets the state of armature objects.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
anim_name_or_id | value | The name of the animation to check |
Returns: real
Adds an animation to the armature pose.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
anim_name_or_id | value | The name of the animation to play |
progress | real | The progress, as a number between 0 and 1, of the animation |
blend_amount (optional) | real | The intensity of the animation |
Returns: N/A
Updates the world transformation of armature objects.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to update |
skin_data (optional) | value | The skin to use |
Returns: N/A
Renders a debug view of the armature.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to render |
x (optional) | real | The X offset to render the armature at |
y (optional) | real | The Y offset to render the armature at |
xscale (optional) | real | The X scale to render the armature with |
yscale (optional) | real | The X scale to render the armature with |
Returns: N/A
Renders a debug view of an armature atlas.
Name | Type | Description |
---|---|---|
arm | struct | The Disarm instance to render |
atlas_name_or_id | real | The name of the atlas the draw |
x | real | The X position to render the atlas debug window |
y | real | The Y position to render the atlas debug window |
width (optional) | real | The width of the debug window |
height (optional) | real | The height of the debug window |
Returns: N/A
Creates a new Disarm mesh that manages the rendering of Disarm animations.
Returns: struct
Destroys this Disarm mesh. Because Disarm meshes use vertex buffers, this function must be called in the Clean-up event of any objects that use it.
Name | Type | Description |
---|---|---|
mesh | struct | The Disarm mesh to destroy |
Returns: N/A
Resets the draw options for this mesh.
Name | Type | Description |
---|---|---|
mesh | struct | The Disarm mesh to begin drawing |
Returns: N/A
Adds the current world transform of an armature to this mesh.
Name | Type | Description |
---|---|---|
mesh | struct | The Disarm mesh to add vertices to |
arm | struct | The armature to get vertices from |
x (optional) | real | The X offset to render the armature at |
y (optional) | real | The Y offset to render the armature at |
xscale (optional) | real | The X scale to render the armature with |
yscale (optional) | real | The Y scale to render the armature with |
Returns: N/A
Finalises the drawing of this mesh.
Name | Type | Description |
---|---|---|
mesh | struct | The Disarm mesh to finalise |
Returns: N/A
Submits this mesh to the draw pipeline.
Name | Type | Description |
---|---|---|
mesh | struct | The Disarm mesh to draw |
Returns: N/A