Skip to content

Button

Implements

Description

A class representing a button.

Extends

Implements

Constructors

new Button()

new Button(config): Button

Parameters

config: Partial<ButtonConfig>

The configuration for the button.

Returns

Button

Overrides

Container.constructor

Source

src/gameobjects/Button.ts:65

Properties

childrenEditable

childrenEditable: boolean = true

Inherited from

Container.childrenEditable

Source

src/gameobjects/Container.ts:22


editable

editable: boolean = true

Inherited from

Container.editable

Source

src/gameobjects/Container.ts:21


isDown

isDown: boolean

Source

src/gameobjects/Button.ts:50


onDown

onDown: Signal<() => void>

Source

src/gameobjects/Button.ts:40


onOut

onOut: Signal<() => void>

Source

src/gameobjects/Button.ts:42


onOver

onOver: Signal<() => void>

Source

src/gameobjects/Button.ts:43


onPress

onPress: Signal<() => void>

Source

src/gameobjects/Button.ts:44


onUp

onUp: Signal<() => void>

Source

src/gameobjects/Button.ts:41


view

view: Sprite

Source

src/gameobjects/Button.ts:47


__dill_pixel_top_level_class

static __dill_pixel_top_level_class: boolean = true

Inherited from

Container.__dill_pixel_top_level_class

Source

src/gameobjects/Container.ts:20

Accessors

add

get add(): Add

Returns

Add

Source

src/gameobjects/Container.ts:120


app

get app(): T

Returns

T

Source

src/gameobjects/Container.ts:128


cursor

get cursor(): string

Description

Gets the cursor of the button.

set cursor(cursor): void

Description

Sets the cursor of the button.

Parameters

cursor: string

The cursor of the button.

Returns

string

The cursor of the button.

Source

src/gameobjects/Button.ts:127


editMode

get editMode(): boolean

set editMode(value): void

Parameters

value: boolean

Returns

boolean

Source

src/gameobjects/Container.ts:107


enabled

set enabled(enabled): void

Description

Sets the enabled state of the button.

Parameters

enabled: boolean

Whether the button is enabled.

Source

src/gameobjects/Button.ts:91


focusPosition

get focusPosition(): Point

set focusPosition(value): void

Parameters

value: Point

Returns

Point

Source

src/gameobjects/Container.ts:83


focusSize

get focusSize(): Point

set focusSize(value): void

Parameters

value: Point

Returns

Point

Source

src/gameobjects/Container.ts:91


focusable

get focusable(): boolean

set focusable(value): void

Parameters

value: boolean

Returns

boolean

Source

src/gameobjects/Container.ts:99


make

get make(): typeof Make

Returns

typeof Make

Source

src/gameobjects/Container.ts:124


useAsCaptionTarget

get useAsCaptionTarget(): boolean

set useAsCaptionTarget(value): void

Parameters

value: boolean

Returns

boolean

Source

src/gameobjects/Container.ts:61


voiceover

get voiceover(): string

set voiceover(value): void

Parameters

value: string

Returns

string

Source

src/gameobjects/Container.ts:69

Methods

destroy()

destroy(_options?): void

Parameters

_options?: boolean | IDestroyOptions

Returns

void

Inherited from

Container.destroy

Source

src/gameobjects/Container.ts:132


disableEditMode()

disableEditMode(): void

Returns

void

Inherited from

Container.disableEditMode

Source

src/gameobjects/Container.ts:173


enableEditMode()

enableEditMode(): void

Returns

void

Inherited from

Container.enableEditMode

Source

src/gameobjects/Container.ts:169


getFocusPosition()

getFocusPosition(): Point

Gets the position in global coordinate space that the focus should be centred around.

Returns

Point

The position that the focus should be centred around.

Implementation of

IFocusable.getFocusPosition

Inherited from

Container.getFocusPosition

Source

src/gameobjects/Container.ts:157


getFocusSize()

getFocusSize(): Point

Returns

Point

The focus size.

Implementation of

IFocusable.getFocusSize

Overrides

Container.getFocusSize

Description

Gets the focus size of the button.

Source

src/gameobjects/Button.ts:157


isFocusable()

isFocusable(): boolean

Returns

boolean

true if this focusable can be focused Defaults to this.interactive && this.worldVisible

Implementation of

IFocusable.isFocusable

Inherited from

Container.isFocusable

Source

src/gameobjects/Container.ts:165


onFocusActivated()

onFocusActivated(): void

Returns

void

Implementation of

IFocusable.onFocusActivated

Overrides

Container.onFocusActivated

Description

Handles the focus activated event.

Source

src/gameobjects/Button.ts:141


onFocusBegin()

onFocusBegin(): void

Returns

void

Implementation of

IFocusable.onFocusBegin

Overrides

Container.onFocusBegin

Description

Handles the focus begin event.

Source

src/gameobjects/Button.ts:134


onFocusEnd()

onFocusEnd(): void

Returns

void

Implementation of

IFocusable.onFocusEnd

Overrides

Container.onFocusEnd

Description

Handles the focus end event.

Source

src/gameobjects/Button.ts:149


onResize()

onResize(_size): void

Parameters

_size: IPoint

Returns

void

Inherited from

Container.onResize

Source

src/gameobjects/Container.ts:179


update()

update(_deltaTime): void

Parameters

_deltaTime: number

Returns

void

Inherited from

Container.update

Source

src/gameobjects/Container.ts:183