UiContainer

Extends: BGE.UI.UiWidget

Properties

  • backgroundRGBA (integer) — RGBA value for the background of the window/container
  • showBackground (boolean) — RGBA value for the background of the window/container
  • children (dynamic)

Constructor

new UiContainer(game: BGE.Game): UiContainer

Parameters


Instance Methods

onRemove(): void

Method for handling any actions needed when this is removed from view Clears all children

Returns

  • void

addChild(element: UiWidget): void

Parameters

Returns

  • void

removeChild(element: UiWidget): void

Parameters

Returns

  • void

clearChildren(): void

Returns

  • void

onUpdate(deltaTime: float): void

Method for handling any updates based on time since previous frame Calls same method in all children

Parameters

  • deltaTime (float) — milliseconds since last frame

Returns

  • void

setCanvas(canvas?: BGE.Canvas): void

Set the canvas this UIWidget Draws to Sets the canvas on all children

Parameters

  • canvas (BGE.Canvas, optional, default: "invalid") — The canvas this should draw to - if invalid, then will draw to the game canvas

Returns

  • void

draw(): void

Method called each frame to draw any images of this entity

Returns

  • void

getValue(): void

Function to get the value of the UIContainer, which will be an object of all the values of the children

Returns

  • void

onInput(input: BGE.GameInput): void

Method to process input per frame Calls same method in all children

Parameters

Returns

  • void

onECPKeyboard(char: integer): void

Method to process an ECP keyboard event

Parameters

  • char (integer)

Returns

  • void

onECPInput(data: roInputEvent): void

Method to process an External Control Protocol event

Parameters

  • data (roInputEvent)

Returns

  • void

onAudioEvent(msg: roAudioPlayerEvent): void

Method to handle audio events

Parameters

  • msg (roAudioPlayerEvent) — roAudioPlayerEvent

Returns

  • void

onPause(): void

Called when the game pauses Calls same method in all children

Returns

  • void

onResume(pauseTimeMs: integer): void

Called when the game unpauses Calls same method in all children

Parameters

  • pauseTimeMs (integer) — The number of milliseconds the game was paused

Returns

  • void

onUrlEvent(msg: roUrlEvent): void

Called on url event

Parameters

  • msg (roUrlEvent) — roUrlEvent

Returns

  • void

onGameEvent(eventName: string, data: roAssociativeArray): void

General purpose event handler for in-game events. Calls same method in all children

Parameters

  • eventName (string) — Event name that describes the event type
  • data (roAssociativeArray) — Any extra data to go along with the event

Returns

  • void

onChangeRoom(newRoom: Room): void

Method called when the current room changes. This method is only called when the entity is marked as persistant, otherwise entities are destroyed on room changes. Calls same method in all children

Parameters

  • newRoom (Room) — The next room

Returns

  • void

onDestroy(): void

Method called when this entity is destroyed

Returns

  • void