eg-overlay-ui#

local ui = require 'eg-overlay-ui'

The eg-overlay-ui module is used to create all UI elements for EG-Overlay modules.

Nearly all modules that display a UI will have at least one window(). Windows use layout or scroll elements to display their child elements.

Top Level Elements:

Layouts:

Child Elements:

General UI Functions#

eg-overlay-ui.mouseposition()#

Return the last known mouse cursor position, relative to the overlay area.

Warning

This does not query the OS to get the actual position, instead it returns the position the cursor was in the last time an event came in.

The overlay does not receive events if the target window (ie. Guild Wars 2) is not focused.

Returns:

2 integers

Version History

Version

Notes

0.3.0

Added

eg-overlay-ui.iconcodepoint(name)#

Return the utf-8 encoded codepoint for the given icon name.

Return type:

string

Version History

Version

Notes

0.3.0

Added

eg-overlay-ui.color(name)#

Return the color for the given UI color name.

Parameters:

name (string)

Return type:

integer

name must be one of the following values:

  • windowBG

  • windowBorder

  • windowBorderHighlight

  • text

  • accentText

  • entryBG

  • entryHint

  • buttonBG

  • buttonBGHover

  • buttonBGHighlight

  • buttonBorder

  • scrollThumb

  • scrollThumbHighlight

  • scrollBG

  • menuBG

  • menuBorder

  • menuItemHover

  • menuItemHighlight

Version History

Version

Notes

0.3.0

Added

eg-overlay-ui.overlaysize()#

Return the width and heigh of the overlay.

Returns:

2 integers

Version History

Version

Notes

0.3.0

Added

UI Elements#

class eg-overlay-ui.uielement#

uielement is the base class for all UI elements.

All of the methods listed below can be called on any UI element.

Important

If you receive a Lua error with the message:

Argument 1 is not a UI Element. (not userdata)

Ensure that you are calling the method as a class method, not a function. I.e., element:method() and not element.method()

x([position])#

Set or get the current position X.

Parameters:

position (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually position an element.

Version History

Version

Notes

0.3.0

Added

y([position])#

Set or get the current position Y.

Parameters:

position (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually position an element.

Version History

Version

Notes

0.3.0

Added

width([value])#

Get or set the element’s width.

Parameters:

width (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually set an element’s size.

Version History

Version

Notes

0.3.0

Added

height([value])#

Get or set the element’s height.

Parameters:

width (integer) – (Optional)

Return type:

integer

Important

It is normally not necessary to manually set an element’s size.

Version History

Version

Notes

0.3.0

Added

bgcolor([color])#

Get or set the element’s background color.

Parameters:

color (integer) – (Optional)

Return type:

integer

Version History

Version

Notes

0.3.0

Added

Colors#

All colors in EG-Overlay are represented by 32bit integers in RGBA format. This may sound complicated, but it is actually convenient for module authors since colors can be specified in hex format, similar to CSS.

For example, red at 100% opacity is 0xFF0000FF, green is 0x00FF00FF, and blue is 0x0000FFFF.

See also

Standard/default colors can be retrieved from color()