mooball
    Preparing search index...

    Interface Gui

    This object holds all serializable GUI data that is shared between host and client.

    interface Gui {
        addControl(name: string, keys: number[]): void;
        ClickEventHandler: GuiClickEventHandler;
        Component: GuiComponent;
        components: { [id: number]: GuiComponent };
        controls: GuiControl[];
        createPopup(props: createPopupParams): void;
        createStyle(css: string): void;
        cssVars: { [name: string]: { value: string } };
        defineCssVar(name: string, initialValue: string): void;
        popups: { [id: number]: GuiPopup };
        registerSound(name: string, url: string): void;
        removeControl(name: string): void;
        sounds: { [name: string]: { url: string } };
        styles: { [id: number]: { css: string } };
    }
    Index

    Properties

    ClickEventHandler: GuiClickEventHandler

    The cick event handler class.

    Component: GuiComponent

    The Component class.

    components: { [id: number]: GuiComponent }

    All components.

    controls: GuiControl[]

    All input controls.

    cssVars: { [name: string]: { value: string } }

    All css variables.

    popups: { [id: number]: GuiPopup }

    All popups.

    sounds: { [name: string]: { url: string } }

    All sounds.

    styles: { [id: number]: { css: string } }

    All css styles.

    Methods

    • Adds an input control to the controls array. Should only be used as host, before anyone has joined the room.

      Parameters

      • name: string

        Name of the input control.

      • keys: number[]

        Default keys or buttons that can be used to trigger this input control.

      Returns void

      void.

    • Adds a Popup object into the popups object. Should only be used as host, before anyone has joined the room.

      Parameters

      Returns void

      void.

      Parameters for creating a Popup.

    • Adds a css Style object into the styles object. Should only be used as host, before anyone has joined the room.

      Parameters

      • css: string

      Returns void

      void.

      The css text that will be added.

    • Adds a css variable object into the cssVars object. Should only be used as host, before anyone has joined the room.

      Parameters

      • name: string

        Unique name of the css variable

      • initialValue: string

        The initial value of the variable.

      Returns void

      void.

    • Adds a sound object into the sounds object. Should only be used as host, before anyone has joined the room.

      Parameters

      • name: string

        Unique name of the sound.

      • url: string

        The url that contains the sound.

      Returns void

      void.

    • Removes an input control from the controls array. Should only be used as host, before anyone has joined the room.

      Parameters

      • name: string

        Name of the input control to remove.

      Returns void

      void.