FlipBook

An animation consisting of a number of still-images. By quickly viewing each of the still-images in sequence an animation appears. The duration of each page is not constant (i.e. on FlipBookPage can be visible longer than others).

Events can be fired. onFinished is fired when the entire flip-book animation is complete. (this will never happen if repeat == true). When each FlipBookPage is finished, FlipBookPage.onPageFinished is fired.

NOTE. This is a mutable class. However, FlipBookAnimation makes COPIES when it is created. So any changes we make to a FlipBook do NOT affect pre-existing FlipBookAnimations.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var onFinished: (Actor) -> Unit?
Link copied to clipboard
Link copied to clipboard

When we finish the last page, we return to the first page. Otherwise, when we get to the last page, we reverse direction

Link copied to clipboard

How many times does this animation repeat? The default value is Int.MAX_VALUE, which is practically repeating forever.

Functions

Link copied to clipboard
open override fun appearance(): FlipBookAnimation

Pose and Graphic return themselves. NinePatch returns a NinePatchAppearance.

Link copied to clipboard
open override fun appearanceForActor(actor: Actor): FlipBookAnimation

Creates an Appearance with the same tint. Also, if the new appearances is StretchableAppearance then it will have the same bounds as the previous appearance.

Link copied to clipboard
open fun applyToActor(actor: Actor)

Set the actor's appearance.

Link copied to clipboard
fun onFinished(block: (Actor) -> Unit)
Link copied to clipboard
fun FlipBook.page(appearance: WithAppearance?, seconds: Float, block: FlipBookPageBuilder.() -> Unit? = null)

Syntactic sugar for adding a FlipBookPage to a FlipBook.