GraphicAppearance

Constructors

Link copied to clipboard
constructor(graphic: Graphic)

Properties

Link copied to clipboard
Link copied to clipboard
open override var tint: Color
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.

Link copied to clipboard
open override val tintProperty: ColorProperty

When we draw, every pixel is multiplied by this tint color. The default tint is fully-opaque white (1,1,1,1), therefore, the final image doesn't change color (or opacity).

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.