Button

Extends: UiWidget

A focusable, clickable button: a label over a themed background. Set onActivate to a function(button as Button) to handle clicks, or subclass and override onClick() directly.

Properties

  • drawableText (BGE.DrawableText)
  • onActivate (dynamic) — Called from onClick() when set - function(button as Button) as void

Constructor

new Button(game: BGE.Game): Button

Parameters


Instance Methods

setLabel(text: string): void

Sets this button's label text.

Parameters

  • text (string)

Returns

  • void

onClick(): void

Returns

  • void

draw(parent?: UiWidget): void

Parameters

  • parent (UiWidget, optional, default: "invalid")

Returns

  • void