Skip to content

styles

styles

Attributes

BACKGROUND_CLASSES = {StageBackGroundStyle.GRID: GridBackground, StageBackGroundStyle.DOTS: DotsBackground} module-attribute

Background class of every style.

Classes

Functions

create_background(style, options)

Create the background of a style.

Parameters:

Name Type Description Default
style StageBackGroundStyle

style of the background.

required
options StageRenderOptions

options the background draws with.

required

Returns:

Type Description
StageBackground

new background.

Source code in src/nyx/editor/graphics/background/styles.py
14
15
16
17
18
19
20
21
22
23
24
25
26
def create_background(
    style: StageBackGroundStyle, options: StageRenderOptions
) -> StageBackground:
    """Create the background of a style.

    Args:
        style (StageBackGroundStyle): style of the background.
        options (StageRenderOptions): options the background draws with.

    Returns:
        StageBackground: new background.
    """
    return BACKGROUND_CLASSES[style](options)