mwg API
    Preparing search index...

    Interface Theme

    How the interface looks.

    Widgets read from here rather than carrying their own colours, so a game restyles its whole interface by assigning one object. Everything has a default that works, so a game that does not care never has to think about it.

    interface Theme {
        color: {
            overlay: number;
            panelBorder: number;
            panelFill: number;
            selection: number;
            text: number;
            textDim: number;
            textHighlight: number;
        };
        direction: Direction;
        font: { family: string; lineHeight: number; size: number };
        overlayAlpha: number;
        padding: number;
        panel?: Texture<TextureSource<any>>;
        panelBorder: number;
        spacing: number;
    }
    Index
    color: {
        overlay: number;
        panelBorder: number;
        panelFill: number;
        selection: number;
        text: number;
        textDim: number;
        textHighlight: number;
    }

    Type Declaration

    • overlay: number

      the dim layer behind a modal window

    • panelBorder: number
    • panelFill: number

      used for the flat panel when no texture is set

    • selection: number
    • text: number
    • textDim: number
    • textHighlight: number
    direction: Direction

    What widgets lay themselves out against, instead of a hardcoded "left".

    A game with mwg/i18n sets this from I18n.direction() whenever the active language changes; a game without it never has to think about the field at all.

    font: { family: string; lineHeight: number; size: number }

    Type Declaration

    • family: string
    • lineHeight: number

      distance between baselines, as a multiple of size

    • size: number
    overlayAlpha: number

    opacity of the layer behind a modal window, 0 to 1

    padding: number

    space between a window's frame and its contents

    panel?: Texture<TextureSource<any>>

    the panel texture behind windows; without one, windows draw a flat rectangle

    panelBorder: number

    how many pixels of panel are its fixed border

    spacing: number

    space between stacked items in a list