ui_set_widget_anchor

From Reflex Wiki
Jump to: navigation, search
ui_set_widget_anchor
Defines the widget's anchor.
Parameter(s) <widgetname> <x> <y>
ui_set_widget_anchor <widgetname> <x> <y>
  • <x>: -1 is left, 0 is middle, 1 is right.
  • <y>: -1 is top, 0 is middle, 1 is bottom.

All <x> and <y> coordinates in scripts are relative to their anchors.

Tip: It is recommended to externally set the <x> and <y> offsets e.g. in game.cfg, instead of hard-coding them into the .lua UI script. This way widgets can easily be repositioned by the user.