UI Anchor
Anchor
Bases: IntEnum
Relative position of a UI element from a specific point.
BOTTOM
class-attribute
instance-attribute
Position is based on the bottom area of this element.
BOTTOM_LEFT
class-attribute
instance-attribute
Position is based on the bottom-left area of this element.
BOTTOM_RIGHT
class-attribute
instance-attribute
Position is based on the bottom-right area of this element.
CENTER
class-attribute
instance-attribute
Position is based on the center area of this element.
LEFT
class-attribute
instance-attribute
Position is based on the left area of this element.
RIGHT
class-attribute
instance-attribute
Position is based on the right area of this element.
TOP
class-attribute
instance-attribute
Position is based on the top area of this element.
TOP_LEFT
class-attribute
instance-attribute
Position is based on the top-left area of this element.
TOP_RIGHT
class-attribute
instance-attribute
Position is based on the top-right area of this element.
calculate_position
staticmethod
calculate_position(
position: IntVector2, size: IntVector2, anchor: Anchor
) -> IntVector2
Calculate the relative position of an element based on an anchor point.
| PARAMETER | DESCRIPTION |
|---|---|
position
|
The X, Y relative position.
TYPE:
|
size
|
The X, Y relative size.
TYPE:
|
anchor
|
The anchor point to calculate to.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IntVector2
|
The calculated position relative to the anchor point. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|