UiWidget

Label~BGE/UI. UiWidget

Base Abstract class for all UI Elements

Constructor

new UiWidget(game) → {void}

Parameters:
Name Type Description
game BGE.Game
Properties:
Name Type Description
customPosition boolean

If position = "custom", then m.customX is horizontal position of this element from the parent position ' and m.customY is the vertical position of this element from the parent position (positive is down)

customX float
customY float
horizAlign string

If customPosition is false, this dictates where horizontally in the container this element should go. Can be: "left", "center" or "right"

vertAlign string

If customPosition is false, this dictates where vertically in the container this element should go. Can be: "top", "center" or "bottom"

width integer

Width of the element

height integer

Height of the element

canvas object
padding Offset
margin Offset
Source:

Extends

  • BGE.GameEntity

Methods

draw(parentopt) → {void}

Method called each frame to draw any images of this entity

Parameters:
Name Type Attributes Default Description
parent object <optional>
invalid

the parent of this Ui Element - will be an object with {x, y, width, height}

Source:

getDrawPosition(parentopt) → {object}

Method called each frame to draw any images of this entity

Parameters:
Name Type Attributes Default Description
parent object <optional>
invalid

the parent of this Ui Element - will be an object with {x, y, width, height}

Source:

getValue() → {dynamic}

Function to get the value of the UI element

Source:

repositionBasedOnParent(parentopt) → {void}

Method called each frame to reposition

Parameters:
Name Type Attributes Default Description
parent object <optional>
invalid

the parent of this Ui Element - will be an object with {x, y, width, height}

Source:

setCanvas(canvasopt) → {void}

Set the canvas this UIWidgetDraws to

Parameters:
Name Type Attributes Default Description
canvas object <optional>
invalid

The canvas this should draw to - if invalid, then will draw to the game canvas

Source: