Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LCDGetLocation

From RoR Wiki

UI Lua API · LCD functions
Version: WAR 1.4.8

Returns the position of an element on an LCD page.

x, y = LCDGetLocation(pageName, elementName)

Arguments

pageName
string – Name of the page.
elementName
string – Name of an element on that page.

Returns

x
number – Horizontal position in pixels.
y
number – Vertical position in pixels.

Details

  • If the page or element does not exist, an error below is logged and nothing is returned.
  • The errors name LCDSetLocation, not LCDGetLocation: the client uses that name for the element lookup.
  • The function needs at least two arguments and only reads the last two.
  • The stock UI never calls this function.

Errors

  • Error in function call 'LCDSetLocation': Page '%s' does not exist.
  • Error in function call 'LCDSetLocation': Page '%s' does not have a child named '%s'.

Example

A minimal example built from the signature:

local x, y = LCDGetLocation( "MyPage", "Title" )
LCDSetLocation( "MyPage", "Title", x, y + 10 )

See also