API (v2.0.0) - Giro3D
    Preparing search index...

    Interface TypedController<T>

    interface TypedController<T> {
        getValue: () => T;
        initialValue: T | undefined;
        onChange: (callback: (value: T) => void) => this;
        onFinishChange: (callback: (value: T) => void) => this;
        setValue: (value: T) => this;
    }

    Type Parameters

    • T

    Hierarchy

    • Controller
      • TypedController
    Index

    Properties

    getValue: () => T

    Returns object[ property ].

    Type Declaration

      • (): T
      • Returns T

    initialValue: T | undefined

    The value of object[ property ] when the controller was created.

    onChange: (callback: (value: T) => void) => this

    Pass a function to be called whenever the value is modified by this controller. The function receives the new value as its first parameter. The value of this will be the controller.

    Type Declaration

      • (callback: (value: T) => void): this
      • Parameters

        • callback: (value: T) => void

        Returns this

    const controller = gui.add( object, 'property' );

    controller.onChange( function( v ) {
    console.log( 'The value is now ' + v );
    console.assert( this === controller );
    } );
    onFinishChange: (callback: (value: T) => void) => this

    Pass a function to be called after this controller has been modified and loses focus.

    Type Declaration

      • (callback: (value: T) => void): this
      • Parameters

        • callback: (value: T) => void

        Returns this

    const controller = gui.add( object, 'property' );

    controller.onFinishChange( function( v ) {
    console.log( 'Changes complete: ' + v );
    console.assert( this === controller );
    } );
    setValue: (value: T) => this

    Sets the value of object[ property ], invokes any onChange handlers and updates the display.

    Type Declaration

      • (value: T): this
      • Parameters

        • value: T

        Returns this