FlipBookPage

class FlipBookPage(val withAppearance: WithAppearance?, val seconds: Float, val tick: (Actor, Float) -> Unit? = null, val progress: (Actor, Float) -> Unit? = null, val onPageStarted: (Actor) -> Unit? = null, val onPageFinished: (Actor) -> Unit? = null)

A page within a FlipBook. It has an appearance (withAppearance) and a duration in seconds.

Constructors

Link copied to clipboard
constructor(withAppearance: WithAppearance?, seconds: Float, tick: (Actor, Float) -> Unit? = null, progress: (Actor, Float) -> Unit? = null, onPageStarted: (Actor) -> Unit? = null, onPageFinished: (Actor) -> Unit? = null)

Properties

Link copied to clipboard
val onPageFinished: (Actor) -> Unit? = null

We can optionally perform an arbitrary action at the end of this page. e.g. play a sound, change attributes of the actor or its behaviour, such as its speed, direction...

Link copied to clipboard
val onPageStarted: (Actor) -> Unit? = null
Link copied to clipboard
val progress: (Actor, Float) -> Unit? = null

An optional action to take while on this page. Very similar to tick, but the Float argument is the progress of this page in the range 0..1.

Link copied to clipboard

The duration of this page

Link copied to clipboard
val tick: (Actor, Float) -> Unit? = null

An optional action to take while on this page.

Link copied to clipboard

Q. Each page needs an Appearance, so why are we using WithAppearance instead?