| Parameters : |
- font_size: int, default to 12
Font size of the text
- font_name: str, default to DEFAULT_FONT
Font name of the text
- bold: bool, default to False
Activate “bold” text style
- italic: bool, default to False
Activate “italic” text style
- size: list, default to (None, None)
Add constraint to render the text (inside a bounding box)
If no size is given, the label size will be adapted from the text size.
- anchor_x: str, default to “left”
Indicate what represent the X position inside the bounding box.
Can be one of “left”, “center”, “right”.
- anchor_y: str, default to “bottom”
Indicate what represent the Y position inside the bounding box.
Can be one of “top”, “middle”, “bottom”.
- padding: int, default to None
If it’s a integer, it will set padding_x and padding_y
- padding_x: int, default to 0
Left/right padding
- padding_y: int, default to 0
Top/bottom padding
- halign: str, default to “left”
Horizontal text alignement inside bounding box
- valign: str, default to “bottom”
Vertical text alignement inside bounding box
- color: list, default to (1, 1, 1, 1)
Text color in (R, G, B, A)
- viewport_pos: list, default to None
An bottom/left position of the viewport inside the label texture.
This property is used only if viewport_size is set.
- viewport_size: list, default to None
Width/height of the viewport, if you don’t want to show the whole
texture. This could be used to limit the drawing of the label to a
certain zone, and prevent to drawing outside the viewport.
If the label have a size of (1800, 25) with a viewport_size of (100,
100), the drawing will not go outside the viewport, but start from
(0, 0).
If you want to draw another part of the texture, use viewport_pos.
|