Container for UI appearance, layout, and sizing settings. Access via the 'ui' submodule.
Experimental API:
The ui submodule is an experimental and new API that is highly susceptible to breaking changes in the future.
Style(background_color: Color | None = None, texture: Texture | None = None, slice: Rect = ..., offset: Vec2 = ..., font: Font | None = None, text_color: Color | None = None, padding: float = 0.0, margin: float = 0.0, gap: float = 0.0, border_width: int = 0, border_radius: float = 0.0, border_color: Color | None = None, width: float | None = None, height: float | None = None) → StyleStyle(background_color: Color | None = None, texture: Texture | None = None, slice: Rect = ..., offset: Vec2 = ..., font: Font | None = None, text_color: Color | None = None, padding: float = 0.0, margin: float = 0.0, gap: float = 0.0, border_width: int = 0, border_radius: float = 0.0, border_color: Color | None = None, width: float | None = None, height: float | None = None) → Style
Container for UI appearance, layout, and sizing settings.
| Name | Description | Type |
|---|---|---|
background_color | The background color of the element (if no texture is provided). | Color | None |
texture | The texture to use for the element. | Texture |
slice | The region of the texture to use. | Rect |
offset | The offset of the element within its parent. | Vec2 |
font | The font to use for text rendering. | Font |
text_color | The color of the text. | Color | None |
padding | The padding around the element. | float |
margin | The margin around the element. | float |
gap | The gap between child elements. | float |
border_width | The width of the border. | int |
border_radius | The radius of the border corners. | float |
border_color | The color of the border. | Color | None |
width | The width of the element. | float | None |
height | The height of the element. | float | None |