melonJS
    Preparing search index...

    Interface UIPanelSettings

    The settings a UIPanel takes. Only width and height are required; with nothing else the panel is an invisible, blocking box that holds children.

    interface UIPanelSettings {
        align?: UIPanelAlign;
        autoSize?: boolean;
        blocking?: boolean;
        bobAmplitude?: number;
        bobPeriod?: number;
        borderColor?: Paint | null;
        borderWidth?: number;
        columns?: number;
        draggable?: boolean;
        fillColor?: Paint | null;
        gap?: number;
        height: number;
        hoverScale?: number;
        layout?: UIPanelLayout;
        onScroll?: (scrollX: number, scrollY: number, panel: UIPanel) => void;
        padding?: number;
        pressScale?: number;
        radius?: number;
        scroll?: UIPanelScroll;
        scrollbarColor?: Paint;
        shadowBlur?: number;
        shadowColor?: Paint | null;
        shadowOffsetX?: number;
        shadowOffsetY?: number;
        skin?: UIPanelSkin;
        title?: string;
        titleFillStyle?: string;
        titleFont?: string;
        titleFontSize?: number;
        width: number;
    }

    Hierarchy (View Summary)

    Index
    align?: UIPanelAlign

    where children line up across the layout; see UIPanelAlign

    "start"
    
    autoSize?: boolean

    Resize the panel to fit its laid out content: the height of a column or a grid, the width of a row, and the other side of a column or a row too unless align is "stretch". Ignored by a scrolling panel.

    false
    
    blocking?: boolean

    Whether the panel stops pointer events from reaching what is behind it: clicks, releases and hover on the panel itself, and the wheel over a scrolling panel. Widgets inside the panel still get their events.

    Keep it true for a dialog. Set it false for a frame that only decorates, such as a HUD box over a playfield that still takes clicks.

    true
    
    bobAmplitude?: number

    How far the panel floats up and down, in pixels; 0 leaves it still. See UIPanel#bobAmplitude.

    0
    
    bobPeriod?: number

    How long one full up and down float takes, in milliseconds. See UIPanel#bobPeriod.

    2000
    
    borderColor?: Paint | null

    the colour of the border drawn around the edge; null for none

    null
    
    borderWidth?: number

    the border's thickness, in pixels, drawn inside the edge

    1
    
    columns?: number

    the number of cells in each row of a "grid" layout

    2
    
    draggable?: boolean

    Let the player move the panel by dragging it. It is moved by its title or its background, never through a widget on it; a scrolling panel is moved by its title and frame only, as a drag on its content scrolls. The panel comes to the front of its container when pressed.

    false
    
    fillColor?: Paint | null

    The background colour; null leaves it transparent.

    Use this, not backgroundColor: a Container's backgroundColor clears the whole screen to that colour.

    null
    
    gap?: number

    the space between children in a layout, in pixels

    8
    
    height: number

    the panel's height, in pixels

    hoverScale?: number

    The scale the widget is drawn at under the pointer, or while it has the keyboard and gamepad focus, such as 1.05. 1 turns it off.

    1
    
    layout?: UIPanelLayout

    how the children are placed; see UIPanelLayout

    "none"
    
    onScroll?: (scrollX: number, scrollY: number, panel: UIPanel) => void

    called each time the content scrolls, with the new offsets in pixels

    padding?: number

    The space between the content and the panel's frame, in pixels: inside the border or the skin's insets, and below the title.

    0
    
    pressScale?: number

    The scale the widget is drawn at while held down, such as 0.92. 1 turns it off.

    1
    
    radius?: number

    the corner radius, in pixels; 0 is square. The fill, the border and the shadow all follow it.

    0
    
    scroll?: UIPanelScroll

    Which ways the content scrolls when it does not fit: with the mouse wheel over the panel, and by dragging the content, with momentum.

    "none"
    
    scrollbarColor?: Paint

    the colour of the scrollbar, shown while the content does not fit

    "#00000059"
    
    shadowBlur?: number

    how far the shadow's soft edge spreads, in pixels; 0 is a sharp edge

    8
    
    shadowColor?: Paint | null

    The colour of a drop shadow under the panel; null for none. Its alpha sets how dark the shadow is, e.g. "#00000066".

    null
    
    shadowOffsetX?: number

    how far right the shadow falls, in pixels; negative goes left

    0
    
    shadowOffsetY?: number

    how far down the shadow falls, in pixels; negative goes up

    4
    

    draw the background from an atlas region, as a nine-slice; a fillColor set as well is drawn over it

    title?: string

    a title, centred in a band at the top; the content starts below it

    titleFillStyle?: string

    the title's colour

    "#ffffff"
    
    titleFont?: string

    the title's font: a CSS font family, or the name of a loaded bitmap font

    "sans-serif"
    
    titleFontSize?: number

    the title's text height, in pixels; the title band is 1.6 times this

    20
    
    width: number

    the panel's width, in pixels