UI Frame
Frame
Frame(
scene: "Scene",
parent: Element,
*,
position: tuple[Union[int, float], Union[int, float]],
size: tuple[Union[int, float], Union[int, float]],
anchor: Anchor = Anchor.TOP_LEFT,
color: ColorRGBA = None
)
Bases: Element
User-Interface Frame.
Create a new user interface frame.
| PARAMETER | DESCRIPTION |
|---|---|
scene
|
The scene to interface this instance with.
TYPE:
|
parent
|
Any
TYPE:
|
position
|
|
size
|
|
anchor
|
The chosen area of this element to place at the position provided. |
color
|
If provided, the color of this element when rendered.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
set_border
set_border(
color: ColorRGBA = None,
*,
width: int = 1,
radius: int = 0,
radius_bottom_left: int = None,
radius_bottom_right: int = None,
radius_top_left: int = None,
radius_top_right: int = None
) -> None
Set the border attributes of this element.
| PARAMETER | DESCRIPTION |
|---|---|
color
|
The color to set the border as -
TYPE:
|
width
|
The width of the border -
TYPE:
|
radius
|
The radius of the border - Initial value of all corners unless overriden by following parameters.
TYPE:
|
radius_bottom_left
|
The radius of the bottom left corner.
TYPE:
|
radius_bottom_right
|
The radius of the bottom right corner.
TYPE:
|
radius_top_left
|
The radius of the top left corner.
TYPE:
|
radius_top_right
|
The radius of the top right corner.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
If any |
set_transform
set_transform(
*,
anchor: Anchor = None,
position: tuple[
Union[int, float], Union[int, float]
] = None,
size: tuple[Union[int, float], Union[int, float]] = None
) -> None
Set the transform (position, size, anchor) attributes of this element.
| PARAMETER | DESCRIPTION |
|---|---|
anchor
|
If provided, change the anchor point of this element.
TYPE:
|
position
|
If provided, change the position of this element - |
size
|
If provided, change the size of this element - |
Info
anchor, position, or size are optional, but one has to be specified.
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
tween
tween(
*,
position: Iterable[Union[int, float]] = None,
size: Iterable[Union[int, float]] = None,
duration: float,
easing: Callable[[float], float] = Easing.LINEAR
) -> None
Tween/animate this element to an end state over a period of time.
| PARAMETER | DESCRIPTION |
|---|---|
position
|
The end position to reach, if provided. |
size
|
The end size to reach, if provided. |
duration
|
The time in which it'll take to animate this element in seconds.
TYPE:
|
easing
|
The easing function to use when animating.
TYPE:
|
Info
- Parameters
positionandsizeare mutually exclusive. - Either one, or both, has to be passed.
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
add_child
add_child(child: Element) -> None
remove_child
remove_child(child: Element) -> None
render_opengl
render_opengl() -> None
Forceably render this element to the screen using a custom-implemented OpenGL rendering program.
request_render
request_render() -> None
Render this element and it's children to the screen, if enabled.
set_tween_callback
set_tween_callback(
callback: Callable[[None], None],
) -> None
Set a callback method for when this element finishes tweening/animating.