Skip to content

Frame Animator

Sprite sheet frame-by-frame animator with configurable frame durations, loops, and ping-pong modes.

Type: FrameAnimationNode · Category: Animation & Effects · Also found as: animationnode, frameanimation, animation

Saved in the scene beside the common properties:

Setting Scene key
Frames frames The images, in order (project paths)
FPS fps Frames per second
Loop loop Start over after the last frame

A Frame Animation plays a list of separate images. For sprite sheets, several named animations, property tracks and events, use an Animation Player (the Animation tab edits it); for .aseprite files, an Aseprite node.

{
"type": "FrameAnimationNode",
"name": "Flame",
"fps": 12,
"loop": true,
"frames": ["textures/flame_1.png", "textures/flame_2.png", "textures/flame_3.png"]
}

No reflected properties of its own: its settings are described above.

Plus the common properties every node has.

Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.

FrameAnimationNode:connect(event, handler)

Section titled “FrameAnimationNode:connect(event, handler)”

Connects a handler to one of this node’s events: animation_finished (A non-looping animation ended (Aseprite: a tag’s repeats are done)); the tree events; custom ones.

self.node:connect("animation_finished", function(value, source) Log.info("animation_finished") end)
  • event FrameAnimationNodeEvent|string
  • handler fun(value: any, source: FrameAnimationNode)

Returns integer id Connection id for disconnect

Reads an Inspector property by its path (vectors and colours as tables); “script.” reads a field of the node’s script.

local value = self.node:get_property("position")
  • path FrameAnimationNodeProperty|string

Returns any

FrameAnimationNode:set_property(path, value, y)

Section titled “FrameAnimationNode:set_property(path, value, y)”

Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.” a field of the node’s script.

self.node:set_property("position", 100, 50)
  • path FrameAnimationNodeProperty|string
  • value any
  • y? number
{
"type": "FrameAnimationNode",
"name": "FrameAnimator",
"position": [
0,
0
]
}