AnimationManager Class
Utility class for setting animation markers and querying animation length.
Method Index
- getAnimLength(anim)
- setAnimLength(anim, length)
- setMarker(anim, ...)
- setMarkerRaw(anim, fn, arg1, arg2, ...)
- setSecondaryMarker(anim, ...)
Member Index
- anim_length_cache
- anims
function AnimationManager:AnimationManager(anims)
Parameters:
Name | Type | Description |
---|---|---|
anims | ? | ? |
Declared on: line 448 of Lua/graphics.lua.
function AnimationManager:getAnimLength(anim)
Parameters:
Name | Type | Description |
---|---|---|
anim | ? | ? |
Declared on: line 458 of Lua/graphics.lua.
function AnimationManager:setAnimLength(anim, length)
For overriding animations which have builtin repeats or excess frames
Parameters:
Name | Type | Description |
---|---|---|
anim | ? | ? |
length | ? | ? |
Declared on: line 453 of Lua/graphics.lua.
function AnimationManager:setMarker(anim, ...)
Markers can be set using a variety of different arguments:
setMarker(anim_number, position)
setMarker(anim_number, start_position, end_position)
setMarker(anim_number, keyframe_1, keyframe_1_position, keyframe_2, ...)
position should be a table; {x, y} for a tile position, {x, y, "px"} for a
pixel position, with (0, 0) being the origin in both cases.
The first variant of setMarker sets the same marker for each frame.
The second variant does linear interpolation of the two positions between
the first frame and the last frame.
The third variant does linear interpolation between keyframes, and then the
final position for frames after the last keyframe. The keyframe arguments
should be 0-based integers, as in the animation viewer.
To set the markers for multiple animations at once, the anim_number argument
can be a table, in which case the marker is set for all values in the table.
Alternatively, the values function (defined in utility.lua) can be used in
conjection with a for loop to set markers for multiple things.
--
Parameters:
Name | Type | Description |
---|---|---|
anim | ? | ? |
... | ? | ? |
Declared on: line 474 of Lua/graphics.lua.
function AnimationManager:setMarkerRaw(anim, fn, arg1, arg2, ...)
Parameters:
Name | Type | Description |
---|---|---|
anim | ? | ? |
fn | ? | ? |
arg1 | ? | ? |
arg2 | ? | ? |
... | ? | ? |
Declared on: line 511 of Lua/graphics.lua.
function AnimationManager:setSecondaryMarker(anim, ...)
Parameters:
Name | Type | Description |
---|---|---|
anim | ? | ? |
... | ? | ? |
Declared on: line 499 of Lua/graphics.lua.