Extends BBMOD_Resource
constructor
new BBMOD_Animation([_file[, _sha1]])
An animation which can be played using BBMOD_AnimationPlayer.
Name | Type | Description |
---|---|---|
_file | String |
A "*.bbanim" animation file to load. If not specified, then an empty animation is created. |
_sha1 | String |
Expected SHA1 of the file. If the actual one does not match with this, then the model will not be loaded. |
Name | Description |
---|---|
Duration | The duration of the animation (in tics). |
IsLoaded | If false then the animation has not been loaded yet. |
TicsPerSecond | Number of animation tics per second. |
TransitionIn | Duration of transition into this animation (in seconds). Must be a value greater or equal to 0! |
TransitionOut | Duration of transition out of this animation (in seconds). Must be a value greater or equal to 0! |
VersionMajor | The major version of the animation file. |
VersionMinor | The minor version of the animation file. |
Name | Description |
---|---|
add_event | Adds a custom animation event. |
create_transition | Creates a new animation transition. |
from_buffer | Loads animation data from a buffer. |
get_animation_time | Calculates animation time from current time in seconds. |
supports_attachments | Checks whether the animation supports bone attachments. |
supports_bone_transform | Checks whether the animation supports bone transformation through code. |
supports_transitions | Checks whether the animation supports transitions. |
to_buffer | Writes animation data to a buffer. |
Following code loads an animation from a file Walk.bbanim
:
try
{
animWalk = new BBMOD_Animation("Walk.bbanim");
}
catch (_exception)
{
// The animation failed to load!
}
You can also load animations from buffers like so:
var _buffer = buffer_load("Walk.anim");
try
{
animWalk = new BBMOD_Animation().from_buffer(_buffer);
}
catch (_exception)
{
// Failed to load an animation from the buffer!
}
buffer_delete(_buffer);
Copyright © 2023, BlueBurn. Built on March 24, 2023 using GMDoc.