Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface GUI

Gui

const gui = new GUI();
gui.add( document, 'title' );

obj = {
myBoolean: true,
myString: 'lil-gui',
myNumber: 1,
myFunction: function() { alert( 'hi' ) }
}
gui.add( obj, 'myBoolean' ); // checkbox
gui.add( obj, 'myString' ); // text field
gui.add( obj, 'myNumber' ); // number field
gui.add( obj, 'myFunction' ); // button

Hierarchy

  • GUI

Index

Constructors

constructor

Properties

_closed

_closed: boolean

Used to determine if the GUI is closed. Use gui.open() or gui.close() to change this.

_hidden

_hidden: boolean

Used to determine if the GUI is hidden. Use gui.show() or gui.hide() to change this.

_title

_title: string

title.

children

children: (I3JS.GUI | GUIController)[]

The list of controllers and folders contained by this GUI.

controllers

controllers: GUIController[]

The list of controllers contained by this GUI.

domElement

domElement: HTMLElement

The outermost container element.

folders

folders: I3JS.GUI[]

The list of folders contained by this GUI.

parent

parent: I3JS.GUI

The GUI containing this folder, or undefined if this is the root GUI.

root

root: I3JS.GUI

The top level GUI containing this folder, or this if this is the root GUI.

Methods

add

  • add(object: object, property: string, min?: number | object | any[], max?: number, step?: number): GUIController
  • Adds a controller to the GUI, inferring controller type using the typeof operator.

    gui.add( object, 'property' );
    gui.add( object, 'number', 0, 100, 1 );
    gui.add( object, 'options', [ 1, 2, 3 ] );

    Parameters

    • object: object

      The object the controller will modify.

    • property: string

      Name of the property to control.

    • Optional min: number | object | any[]

      Minimum value for number controllers, or the set of selectable values for a dropdown.

    • Optional max: number

      Maximum value for number controllers.

    • Optional step: number

      Step value for number controllers.

    Returns GUIController

    add

addColor

  • addColor(object: object, property: string, rgbScale?: number): GUIController
  • Adds a color controller to the GUI.

    params = {
    cssColor: '#ff00ff',
    rgbColor: { r: 0, g: 0.2, b: 0.4 },
    customRange: [ 0, 127, 255 ],
    };
    gui.addColor( params, 'cssColor' );
    gui.addColor( params, 'rgbColor' );
    gui.addColor( params, 'customRange', 255 );

    Parameters

    • object: object

      The object the controller will modify.

    • property: string

      Name of the property to control.

    • Optional rgbScale: number

    Returns GUIController

    color

addFolder

close

controllersRecursive

destroy

  • destroy(): void

foldersRecursive

hide

load

  • load(obj: object, recursive?: boolean): I3JS.GUI

onChange

onFinishChange

open

reset

  • reset(recursive?: boolean): I3JS.GUI

save

  • save(recursive?: boolean): object

title

Generated using TypeDoc