Appearance

Responsible for drawing an Actor.

An Actor can change appearance over time.

Inheritors

Properties

Link copied to clipboard
open var tintIfAvailable: Color

Most appearances are TintedAppearance, but checking if an appearance is a TintedAppearance can be onerous. This gives the illusion that all appearances have a tint. For those without a tint, the value will be Color.WHITE, and setting this value will do nothing.

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

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

Link copied to clipboard
abstract 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
abstract fun localBounds(): Pair<Vector2, Vector2>

Returns two corners of a bounding rectangle in local coordinates.

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