Skip to content

Literals

Tuple2 module-attribute

Tuple2 = tuple[Number, Number]

A 2-element tuple of numbers, typically used for size or position.

FontStyle module-attribute

FontStyle = Literal['normal', 'italic']

Font style options for text elements.

FontWeight module-attribute

FontWeight = Literal[
    "thin",
    "extralight",
    "light",
    "regular",
    "medium",
    "semibold",
    "bold",
    "extrabold",
    "heavy",
]

Font weight options for text elements.

HorizontalAlignment module-attribute

HorizontalAlignment = Literal['center', 'left', 'right']

Horizontal alignment options for text or UI elements.

VerticalAlignment module-attribute

VerticalAlignment = Literal['bottom', 'center', 'top']

Vertical alignment options for text or UI elements.

Truncate module-attribute

Truncate = Literal['atend', 'none', 'splitword']

Text truncation behavior when content overflows.

ScaleType module-attribute

ScaleType = Literal[
    "crop", "fit", "slice", "stretch", "tile"
]

How images or UI elements scale within a container.

ResampleMode module-attribute

ResampleMode = Literal['default', 'pixelated']

Resampling mode for image scaling.

ProductType module-attribute

ProductType = Literal['asset', 'gamepass', 'product']

Type of product or item being referenced.

OutlineMode module-attribute

OutlineMode = Literal['border', 'contextual']

Outline rendering mode for text. Contextual only works when rich markup is disabled.

OutlineType module-attribute

OutlineType = Literal['bevel', 'miter', 'round']

Type of outline geometry for text elements.

ListDirection module-attribute

ListDirection = Literal['horizontal', 'vertical']

Direction for list layouts or container stacking.

TextSize module-attribute

TextSize = Union[int, float, Literal['scaled']]

Font size, which can be a number in pixels or 'scaled' for dynamic sizing.

CanvasSize module-attribute

CanvasSize = Union[
    Size2, Literal["auto", "auto_x", "auto_y"]
]

Canvas size, either an absolute Size2 or automatic sizing options.

MaxSize module-attribute

MaxSize = Union[Tuple2, Literal['inf']]

Maximum size constraint, either a tuple of numbers or 'inf' for unlimited.

Vec2

Bases: NamedTuple

Represents a 2D vector with x and y coordinates.