Skip to content

Class: UIButton

The basic components used in the GUI to respond to user interaction behavior and have an image component

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new UIButton(): UIButton

Returns

UIButton

Inherited from

UIInteractive.constructor

Properties

object3D

object3D: Object3D = null

owner object3D

Inherited from

UIInteractive.object3D

Defined in

src/components/ComponentBase.ts:17


isDestroyed

Optional isDestroyed: boolean

Inherited from

UIInteractive.isDestroyed

Defined in

src/components/ComponentBase.ts:38

Accessors

eventDispatcher

get eventDispatcher(): CEventDispatcher

Returns

CEventDispatcher

Inherited from

UIInteractive.eventDispatcher

Defined in

src/components/ComponentBase.ts:23

set eventDispatcher(value): void

Parameters

NameType
valueCEventDispatcher

Returns

void

Inherited from

UIInteractive.eventDispatcher

Defined in

src/components/ComponentBase.ts:28


isStart

get isStart(): boolean

Returns

boolean

Inherited from

UIInteractive.isStart

Defined in

src/components/ComponentBase.ts:40


transform

get transform(): Transform

Return the Transform component attached to the Object3D.

Returns

Transform

Inherited from

UIInteractive.transform

Defined in

src/components/ComponentBase.ts:47


enable

get enable(): boolean

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Returns

boolean

Inherited from

UIInteractive.enable

Defined in

src/components/ComponentBase.ts:68

set enable(value): void

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Parameters

NameType
valueboolean

Returns

void

Inherited from

UIInteractive.enable

Defined in

src/components/ComponentBase.ts:54


transition

get transition(): UIButtonTransition

Returns

UIButtonTransition

Defined in

src/components/gui/uiComponents/UIButton.ts:54

set transition(value): void

Parameters

NameType
valueUIButtonTransition

Returns

void

Defined in

src/components/gui/uiComponents/UIButton.ts:47


imageType

get imageType(): ImageType

Returns

ImageType

Defined in

src/components/gui/uiComponents/UIButton.ts:58

set imageType(value): void

Parameters

NameType
valueImageType

Returns

void

Defined in

src/components/gui/uiComponents/UIButton.ts:62


mouseStyle

set mouseStyle(value): void

Parameters

NameType
valueUIInteractiveStyle

Returns

void

Overrides

UIInteractive.mouseStyle

Defined in

src/components/gui/uiComponents/UIButton.ts:78


normalSprite

get normalSprite(): GUISprite

Returns

GUISprite

Defined in

src/components/gui/uiComponents/UIButton.ts:83

set normalSprite(value): void

Parameters

NameType
valueGUISprite

Returns

void

Defined in

src/components/gui/uiComponents/UIButton.ts:87


overSprite

get overSprite(): GUISprite

Returns

GUISprite

Defined in

src/components/gui/uiComponents/UIButton.ts:94

set overSprite(value): void

Parameters

NameType
valueGUISprite

Returns

void

Defined in

src/components/gui/uiComponents/UIButton.ts:98


downSprite

get downSprite(): GUISprite

Returns

GUISprite

Defined in

src/components/gui/uiComponents/UIButton.ts:112

set downSprite(value): void

Parameters

NameType
valueGUISprite

Returns

void

Defined in

src/components/gui/uiComponents/UIButton.ts:105


disableSprite

get disableSprite(): GUISprite

Returns

GUISprite

Defined in

src/components/gui/uiComponents/UIButton.ts:123

set disableSprite(value): void

Parameters

NameType
valueGUISprite

Returns

void

Defined in

src/components/gui/uiComponents/UIButton.ts:116


uiTransform

get uiTransform(): UITransform

Returns

UITransform

Inherited from

UIInteractive.uiTransform

Defined in

src/components/gui/uiComponents/UIComponentBase.ts:16


visible

get visible(): boolean

Returns

boolean

Inherited from

UIInteractive.visible

Defined in

src/components/gui/uiComponents/UIComponentBase.ts:20

set visible(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

UIInteractive.visible

Defined in

src/components/gui/uiComponents/UIComponentBase.ts:24


interactive

get interactive(): boolean

Returns

boolean

Inherited from

UIInteractive.interactive

Defined in

src/components/gui/uiComponents/UIInteractive.ts:23

set interactive(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

UIInteractive.interactive

Defined in

src/components/gui/uiComponents/UIInteractive.ts:19


interactiveVisible

get interactiveVisible(): boolean

Returns

boolean

Inherited from

UIInteractive.interactiveVisible

Defined in

src/components/gui/uiComponents/UIInteractive.ts:31

Methods

start

start(): void

Returns

void

Inherited from

UIInteractive.start

Defined in

src/components/ComponentBase.ts:113


stop

stop(): void

Returns

void

Inherited from

UIInteractive.stop

Defined in

src/components/ComponentBase.ts:114


onUpdate

onUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

UIInteractive.onUpdate

Defined in

src/components/ComponentBase.ts:117


onLateUpdate

onLateUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

UIInteractive.onLateUpdate

Defined in

src/components/ComponentBase.ts:118


onBeforeUpdate

onBeforeUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

UIInteractive.onBeforeUpdate

Defined in

src/components/ComponentBase.ts:119


onCompute

onCompute(view?, command?): any

Parameters

NameType
view?View3D
command?GPUCommandEncoder

Returns

any

Inherited from

UIInteractive.onCompute

Defined in

src/components/ComponentBase.ts:120


onGraphic

onGraphic(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

UIInteractive.onGraphic

Defined in

src/components/ComponentBase.ts:121


onParentChange

onParentChange(lastParent?, currentParent?): any

Parameters

NameType
lastParent?Object3D
currentParent?Object3D

Returns

any

Inherited from

UIInteractive.onParentChange

Defined in

src/components/ComponentBase.ts:122


onAddChild

onAddChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

UIInteractive.onAddChild

Defined in

src/components/ComponentBase.ts:123


onRemoveChild

onRemoveChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

UIInteractive.onRemoveChild

Defined in

src/components/ComponentBase.ts:124


beforeDestroy

beforeDestroy(force?): void

before release this component, object refrences are not be set null now.

Parameters

NameType
force?boolean

Returns

void

Inherited from

UIInteractive.beforeDestroy

Defined in

src/components/ComponentBase.ts:200


init

init(param?): void

Parameters

NameType
param?any

Returns

void

Overrides

UIInteractive.init

Defined in

src/components/gui/uiComponents/UIButton.ts:26


onEnable

onEnable(): void

Returns

void

Overrides

UIInteractive.onEnable

Defined in

src/components/gui/uiComponents/UIButton.ts:39


onDisable

onDisable(): void

Returns

void

Overrides

UIInteractive.onDisable

Defined in

src/components/gui/uiComponents/UIButton.ts:43


setStyleColor

setStyleColor(style, color): this

Parameters

NameType
styleUIInteractiveStyle
colorColor

Returns

this

Defined in

src/components/gui/uiComponents/UIButton.ts:66


getStyleColor

getStyleColor(style): Color

Parameters

NameType
styleUIInteractiveStyle

Returns

Color

Defined in

src/components/gui/uiComponents/UIButton.ts:74


cloneTo

cloneTo(obj): void

clone component data to target object3D

Parameters

NameTypeDescription
objObject3Dtarget object3D

Returns

void

Overrides

UIInteractive.cloneTo

Defined in

src/components/gui/uiComponents/UIButton.ts:139


copyComponent

copyComponent(from): this

Parameters

NameType
fromthis

Returns

this

Overrides

UIInteractive.copyComponent

Defined in

src/components/gui/uiComponents/UIButton.ts:144


destroy

destroy(): void

release this component

Returns

void

Overrides

UIInteractive.destroy

Defined in

src/components/gui/uiComponents/UIButton.ts:162


rayPick

rayPick(ray, panel, screenPos, screenSize): HitInfo

Parameters

NameType
rayRay
panelUIPanel
screenPosVector2
screenSizeVector2

Returns

HitInfo

Inherited from

UIInteractive.rayPick

Defined in

src/components/gui/uiComponents/UIInteractive.ts:45

Released under the MIT License