StretchableAppearance
Appearances whose bounds can be defined by two opposite corners of a rectangle, both of which can be moved anywhere.
Pose and Graphic are not StretchableAppearance, because the corners cannot be arbitrarily changed, they are defined by the pin
and the size of the pose/graphic.
corner1
and corner3
are derived from corner0 and corner2 and therefore are not stored, and aren't mutable.
The rectangular region will be centered iff corner0 == - corner2
In some cases, it is useful to grow/shrink an appearance by changing the position of the corners AND to change the actor's scale. For example, suppose we have a NinePatchAppearance of a framed picture. We can change the size of the picture by changing corner0 and corner2; the picture frame's thickness wouldn't change. If we want a thicker frame, scale the actor. We would also need to move the corners to compensate if we wanted the overall size framed picture to remain unchanged.
Inheritors
Properties
In conjunction with corner2, this defines a rectangle in CoordinateSystem.local coordinates.
In conjunction with corner2, this defines a rectangle in CoordinateSystem.local coordinates.
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
Pose and Graphic return themselves. NinePatch returns a NinePatchAppearance.
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.
Set the actor's appearance.
Given a point in local coordinates, is it within the bounding box of this Appearance?
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.
Returns two corners of a bounding rectangle in local coordinates.
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.