class Eagle::AnimatedSprite2D::Animation

Overview

One named animation: its frames, speed and whether it loops.

Defined in:

eagle/nodes/animated_sprite2d.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, frames : Array(Eagle::TextureRegion), fps : Float32 = 10_f32, loop : Bool = true) #

Creates an animation.


Instance Method Detail

def duration : Float32 #

Length of one pass in seconds.


def fps : Float32 #

Frames per second.


def fps=(fps : Float32) #

Frames per second.


def frames : Array(TextureRegion) #

The regions shown, in order.


def loop=(loop : Bool) #

Whether to start over at the end. Non-looping animations stop on the last frame and emit animation_finished.


def loop? : Bool #

Whether to start over at the end. Non-looping animations stop on the last frame and emit animation_finished.


def name : String #

The animation's name.