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) #

def self.new #

Instance Method Detail

def active : Bool #

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


def current_frame : Int32 #

The current frame that the flipbook is on


def delay : Float64 #

The delay in seconds between frames


def delay=(delay : Float64) #

The delay in seconds between frames


def end_frame : Int32 #

The ending frame of the flipbook


def end_frame=(end_frame : Int32) #

The ending frame of the flipbook


def reset #

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


def resume #

Starts the flipbook while keeping the current frame and delay difference


def start #

Starts the flipbook and resets the frame and delay


def start_frame : Int32 #

The starting frame of the flipbook


def start_frame=(start_frame : Int32) #

The starting frame of the flipbook


def stop #

Stops the flipbook and saves the current delay