ig.

UIElement

new UIElement()

User interface base element. Tip: Impact++ UIElements are meant to be used for simple user interfaces. If you need something complex, it is recommended that you use the DOM!

Author:
  • Collin Hover - collinhover.com
Source:

align :Vector2

Alignment relative to screen size in values from 0 to 1.

Default Value:
  • 0% (top left)
Source:

autoDeactivate :Boolean

Automatically deactivates ui element during cleanup.

Default Value:
  • true
Source:

canFlipX

UI elements don't need to flip like entities.

Source:

canFlipY

UI elements don't need to flip like entities.

Source:

fixed

UI elements are usually fixed in the screen.

Default Value:
  • true
Source:

frozen

UI elements generally do not need to be updated.

Default Value:
  • true
Source:

ignoreSystemScale :Boolean

Whether user interface elements should ignore system scale. IMPORTANT: when true, ui elements will not scale dynamically with view and instead will be fixed in size. This is usually ideal.

Default Value:
  • ig.CONFIG.UI.IGNORE_SYSTEM_SCALE
Source:

layerName

Default Value:
  • ui
Source:

linkAlign :Vector2

Alignment in percent used to offset the element based on ig.UIElement#linkedTo's size.

Default Value:
  • 0%
Source:

linkAlignInside :Boolean

Flips ig.UIElement#linkAlign so that coordinates are relative to inside of linkedTo element

Default Value:
  • false
Source:

margin :Vector2

Pseudo margins that won't actually keep other elements away.
- this is used to offset the element based on the pivot

Default Value:
  • 0%
Source:

marginAsPct :Boolean

Whether to treat margin as a percentage of screen size.

Default Value:
  • true
Source:

marginAsPctSmallest :Boolean

Whether to get margin percentages from smallest dimension in screen size.

Default Value:
  • ig.CONFIG.UI.MARGIN_AS_PCT_SMALLEST
Source:

marginScaleless :Boolean

Whether margins should be calculated consistently at all scales. Ex: a button should be 15px away from the edge no matter the scale.

Default Value:
  • ig.CONFIG.UI.MARGIN_SCALELESS
Source:

posAsPct :Boolean

Whether to get position as a percentage of screen size.

Source:

posPct :Vector2

Percentage of screen size to be converted to position in values from 0 to 1. IMPORTANT: this overrides pos property when ig.UIElement#posAsPct is true.

Default Value:
  • 0%
Source:

scale :Number

Scale that overrides system scale when ig.UIElement#ignoreSystemScale is true.

Default Value:
  • ig.CONFIG.UI.SCALE
Source:

scaleMax :Number

Maximum value of ig.UIElement#scale.

Default Value:
  • ig.CONFIG.UI.SCALE_MAX
Source:

scaleMin :Number

Minimum value of ig.UIElement#scale.

Default Value:
  • ig.CONFIG.UI.SCALE_MIN
Source:

scaleOfSystemScale :Number

Scale of system scale.

Source:

<readonly> totalMarginX :Number

Total horizontal margin, calculated during resize.

Default Value:
  • 0
Source:

<readonly> totalMarginY :Number

Total vertical margin, calculated during resize.

Default Value:
  • 0
Source:

visible

UI elements are usually always visible.
- this plays well when UI element is also ig.UIElement#fixed

Default Value:
  • true
Source:

changePerformanceDynamic()

Source:

cleanup()

Source:

initTypes()

Source:
Source:

moveTo()

Moves UI element to entity or position.

Source:

reposition(force)

Refreshes position.

Parameters:
Name Type Argument Description
force Boolean <optional>
whether to force.
Source:
Source: