melonJS
    Preparing search index...

    Interface UICheckboxSettings

    The settings UICheckbox takes. All are optional.

    The colour settings are for the drawn look and are ignored when a skin is given.

    interface UICheckboxSettings {
        borderColor?: Paint;
        borderWidth?: number;
        boxColor?: Paint;
        boxHoverColor?: Paint;
        boxSize?: number;
        checkColor?: Paint;
        checked?: boolean;
        enabled?: boolean;
        font?: string;
        fontSize?: number;
        group?: string;
        hoverScale?: number;
        label?: string;
        labelFillStyle?: string;
        labelGap?: number;
        labelOff?: string;
        labelOn?: string;
        onChange?: (checked: boolean, checkbox: UICheckbox) => void;
        pressScale?: number;
        radius?: number;
        skin?: UICheckboxSkin;
    }

    Hierarchy (View Summary)

    Index
    borderColor?: Paint

    the box's outline when not checked (drawn look)

    "#3a3a3a"
    
    borderWidth?: number

    the outline's thickness, in pixels (drawn look); 0 for none

    2
    
    boxColor?: Paint

    the box's fill when not checked (drawn look); also the tick's colour

    "#ffffff"
    
    boxHoverColor?: Paint

    the box's fill when not checked and under the pointer (drawn look)

    "#e4eefb"
    
    boxSize?: number

    the side of the box, in pixels; with a skin, the height of its off region by default

    24
    
    checkColor?: Paint

    the box's fill and outline when checked, and a radio button's dot (drawn look)

    "#2a7de1"
    
    checked?: boolean

    whether it starts checked

    false
    
    enabled?: boolean

    whether it answers input; a disabled checkbox is drawn faded, or with the skin's disabledOn / disabledOff regions

    true
    
    font?: string

    a CSS font family, or the name of a loaded bitmap font

    "sans-serif"
    
    fontSize?: number

    the label's text height, in pixels; two thirds of boxSize, and at least 12, by default

    group?: string

    a radio group name: checkboxes sharing it have one checked at a time, and are drawn round. See UICheckbox#group.

    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
    
    label?: string

    the text next to the box, the same in both states; labelOn and labelOff replace it for one state each

    labelFillStyle?: string

    the label's colour

    "#000000"
    
    labelGap?: number

    the space between the box and the label, in pixels

    8
    
    labelOff?: string

    the text while not checked; label if left out

    labelOn?: string

    the text while checked; label if left out

    onChange?: (checked: boolean, checkbox: UICheckbox) => void

    Called with the new state when the user checks or unchecks it (click, tap, or Enter with the focus). Never called when checked is set or toggle() is called from code. See UICheckbox#onChange.

    pressScale?: number

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

    1
    
    radius?: number

    the box's corner radius, in pixels (drawn look); ignored by a radio button, which is round

    4
    

    draw the box from atlas regions instead of the drawn look