Package-level declarations

Types

Link copied to clipboard

Responsible for drawing an Actor.

Link copied to clipboard

Any resource which can be used to create an Appearance. At time of writing, this includes : Role, Graphic, Pose, NinePatch.

Link copied to clipboard
class AtlasGrid
Link copied to clipboard

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

Link copied to clipboard

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 :

Link copied to clipboard
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.

Link copied to clipboard
class FlipBookPageBuilder(val appearance: WithAppearance?, val seconds: Float)

FlipBookPage is immutable, so all attributes must be passed to the constructor, which is very awkward. This makes it much more pleasant.

Link copied to clipboard
Link copied to clipboard

A Resource corresponding to a .png or .jpeg file.

Link copied to clipboard
Link copied to clipboard
class Label(val font: Font, text: String) : TintedAppearance
Link copied to clipboard
class Margins(val top: Float = 0.0f, val right: Float = 0.0f, val bottom: Float = 0.0f, val left: Float = 0.0f)

Used by NinePatch to determine where the central patch is.

Link copied to clipboard
class NinePatch(var parent: ParentResource, name: String, graphicPath: String) : PartialGraphic, AppearanceResource

A rectangular region of a Graphic (which may be the graphic's entire area) which is divided into 9 patches in a grid pattern.

Link copied to clipboard

Draws a NinePatch to fill a rectangular region defined by 2 opposite corners of a rectangle (corner0 and corner2).

Link copied to clipboard

Draws nothing (invisible).

Link copied to clipboard

Common features shared by Pose and NinePatch.

Link copied to clipboard
interface PinnedImage

A Pose or Graphic, both have a pin which determines which point in the image refers to Actor.position.

Link copied to clipboard
open class Pose(var parent: ParentResource, name: String, graphicPath: String) : PartialGraphic, AppearanceResource

A small rectangular region of a Graphic that can be used as an Actor's Appearance.

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

Appearances whose bounds can be defined by two opposite corners of a rectangle, both of which can be moved anywhere.

Link copied to clipboard
Link copied to clipboard
interface WithAppearance

Implemented by anything that can provide an Appearance.

Functions

Link copied to clipboard
fun flipBook(block: FlipBook.() -> Unit): FlipBook

Syntactic sugar for creating FlipBooks.

Link copied to clipboard

Syntactic sugar for creating FlipBookAnimations.

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

Syntactic sugar for adding a FlipBookPage to a FlipBook.