struct Tsh::Flipbook

Overview

Data for sprite animation

Defined in:

plaything.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(start_frame : Int32, end_frame : Int32, delay : Float64) #

[View source]
def self.new #

[View source]

Instance Method Detail

def active : Bool #

Is the flipbook currently going? (Overwrites the PlayThing's sprite with current_frame if true)


[View source]
def current_frame : Int32 #

The current frame that the flipbook is on


[View source]
def delay : Float64 #

The delay in seconds between frames


[View source]
def delay=(delay : Float64) #

The delay in seconds between frames


[View source]
def end_frame : Int32 #

The ending frame of the flipbook


[View source]
def end_frame=(end_frame : Int32) #

The ending frame of the flipbook


[View source]
def reset #

Resets the current frame back to the beginning as well as restarting the delay


[View source]
def resume #

Starts the flipbook while keeping the current frame and delay difference


[View source]
def start #

Starts the flipbook and resets the frame and delay


[View source]
def start_frame : Int32 #

The starting frame of the flipbook


[View source]
def start_frame=(start_frame : Int32) #

The starting frame of the flipbook


[View source]
def stop #

Stops the flipbook and saves the current delay


[View source]