class
Eagle::AnimatedSprite2D::Animation
- Eagle::AnimatedSprite2D::Animation
- Reference
- Object
Overview
One named animation: its frames, speed and whether it loops.
Defined in:
eagle/nodes/animated_sprite2d.crConstructors
-
.new(name : String, frames : Array(Eagle::TextureRegion), fps : Float32 = 10_f32, loop : Bool = true)
Creates an animation.
Instance Method Summary
-
#duration : Float32
Length of one pass in seconds.
-
#fps : Float32
Frames per second.
-
#fps=(fps : Float32)
Frames per second.
-
#frames : Array(TextureRegion)
The regions shown, in order.
-
#loop=(loop : Bool)
Whether to start over at the end.
-
#loop? : Bool
Whether to start over at the end.
-
#name : String
The animation's name.
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 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.