Class: UIButton
The basic components used in the GUI to respond to user interaction behavior and have an image component
Hierarchy
↳
UIButton
Constructors
Properties
Accessors
- eventDispatcher
- isStart
- transform
- enable
- transition
- imageType
- mouseStyle
- normalSprite
- overSprite
- downSprite
- disableSprite
- uiTransform
- visible
- interactive
- interactiveVisible
Methods
- start
- stop
- onUpdate
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- beforeDestroy
- init
- onEnable
- onDisable
- setStyleColor
- getStyleColor
- cloneTo
- copyComponent
- destroy
- rayPick
Constructors
constructor
• new UIButton(): UIButton
Returns
Inherited from
Properties
object3D
• object3D: Object3D
= null
owner object3D
Inherited from
Defined in
src/components/ComponentBase.ts:17
isDestroyed
• Optional
isDestroyed: boolean
Inherited from
Defined in
src/components/ComponentBase.ts:38
Accessors
eventDispatcher
• get
eventDispatcher(): CEventDispatcher
Returns
Inherited from
UIInteractive.eventDispatcher
Defined in
src/components/ComponentBase.ts:23
• set
eventDispatcher(value
): void
Parameters
Name | Type |
---|---|
value | CEventDispatcher |
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
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
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
UIInteractive.enable
Defined in
src/components/ComponentBase.ts:54
transition
• get
transition(): UIButtonTransition
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:54
• set
transition(value
): void
Parameters
Name | Type |
---|---|
value | UIButtonTransition |
Returns
void
Defined in
src/components/gui/uiComponents/UIButton.ts:47
imageType
• get
imageType(): ImageType
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:58
• set
imageType(value
): void
Parameters
Name | Type |
---|---|
value | ImageType |
Returns
void
Defined in
src/components/gui/uiComponents/UIButton.ts:62
mouseStyle
• set
mouseStyle(value
): void
Parameters
Name | Type |
---|---|
value | UIInteractiveStyle |
Returns
void
Overrides
UIInteractive.mouseStyle
Defined in
src/components/gui/uiComponents/UIButton.ts:78
normalSprite
• get
normalSprite(): GUISprite
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:83
• set
normalSprite(value
): void
Parameters
Name | Type |
---|---|
value | GUISprite |
Returns
void
Defined in
src/components/gui/uiComponents/UIButton.ts:87
overSprite
• get
overSprite(): GUISprite
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:94
• set
overSprite(value
): void
Parameters
Name | Type |
---|---|
value | GUISprite |
Returns
void
Defined in
src/components/gui/uiComponents/UIButton.ts:98
downSprite
• get
downSprite(): GUISprite
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:112
• set
downSprite(value
): void
Parameters
Name | Type |
---|---|
value | GUISprite |
Returns
void
Defined in
src/components/gui/uiComponents/UIButton.ts:105
disableSprite
• get
disableSprite(): GUISprite
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:123
• set
disableSprite(value
): void
Parameters
Name | Type |
---|---|
value | GUISprite |
Returns
void
Defined in
src/components/gui/uiComponents/UIButton.ts:116
uiTransform
• get
uiTransform(): UITransform
Returns
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
Name | Type |
---|---|
value | boolean |
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
Name | Type |
---|---|
value | boolean |
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
Defined in
src/components/ComponentBase.ts:113
stop
▸ stop(): void
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:114
onUpdate
▸ onUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:117
onLateUpdate
▸ onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:119
onCompute
▸ onCompute(view?
, command?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:120
onGraphic
▸ onGraphic(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:121
onParentChange
▸ onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:122
onAddChild
▸ onAddChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:123
onRemoveChild
▸ onRemoveChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:124
beforeDestroy
▸ beforeDestroy(force?
): void
before release this component, object refrences are not be set null now.
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:200
init
▸ init(param?
): void
Parameters
Name | Type |
---|---|
param? | any |
Returns
void
Overrides
Defined in
src/components/gui/uiComponents/UIButton.ts:26
onEnable
▸ onEnable(): void
Returns
void
Overrides
Defined in
src/components/gui/uiComponents/UIButton.ts:39
onDisable
▸ onDisable(): void
Returns
void
Overrides
Defined in
src/components/gui/uiComponents/UIButton.ts:43
setStyleColor
▸ setStyleColor(style
, color
): this
Parameters
Name | Type |
---|---|
style | UIInteractiveStyle |
color | Color |
Returns
this
Defined in
src/components/gui/uiComponents/UIButton.ts:66
getStyleColor
▸ getStyleColor(style
): Color
Parameters
Name | Type |
---|---|
style | UIInteractiveStyle |
Returns
Defined in
src/components/gui/uiComponents/UIButton.ts:74
cloneTo
▸ cloneTo(obj
): void
clone component data to target object3D
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | target object3D |
Returns
void
Overrides
Defined in
src/components/gui/uiComponents/UIButton.ts:139
copyComponent
▸ copyComponent(from
): this
Parameters
Name | Type |
---|---|
from | this |
Returns
this
Overrides
Defined in
src/components/gui/uiComponents/UIButton.ts:144
destroy
▸ destroy(): void
release this component
Returns
void
Overrides
Defined in
src/components/gui/uiComponents/UIButton.ts:162
rayPick
▸ rayPick(ray
, panel
, screenPos
, screenSize
): HitInfo
Parameters
Name | Type |
---|---|
ray | Ray |
panel | UIPanel |
screenPos | Vector2 |
screenSize | Vector2 |