FlipBookAnimation

NOTE. tick is NOT called automatically, therefore call this from the Actor's Behaviour. This is a deliberate deign choice (not an oversight, or laziness). For example, suppose an actor can be frozen, then your behaviour will contain something like this :

if (!frozen) {
    (actor.appearance as? Ticks)?.tick( ... )
}

Constructors

Link copied to clipboard
constructor(flipBook: FlipBook, actor: Actor)
constructor(flipBook: FlipBook)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

How long till we need to turn to the next page in the FlipBook.

Link copied to clipboard

The amount of time the current page has been shown.

Link copied to clipboard
Link copied to clipboard
open override var tintIfAvailable: Color

Forwards get/set to the currentAppearance.

Functions

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

Pose and Graphic return themselves. NinePatch returns a NinePatchAppearance.

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

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
open override fun containsLocalPoint(localPoint: Vector2): Boolean

Given a point in local coordinates, is it within the bounding box of this Appearance?

Link copied to clipboard
open override fun draw(modelMatrix: Matrix?)

The actor's transformation has already been applied to Backend (using Backend.transform). So we do NOT need to use Actor.position, Actor.scale or Actor.angleRadians.

Link copied to clipboard
open override fun localBounds(): Pair<Vector2, Vector2>

Returns two corners of a bounding rectangle in local coordinates.

Link copied to clipboard
open override fun localCorners(): List<Vector2>

Returns a list of local points which describes the bounding polygon. local means the points are unrelated to the Actor's position, angle or scale.

Link copied to clipboard
open override fun tick(actor: Actor, seconds: Float)