Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:MoveWindowToWorldObject

From RoR Wiki
Revision as of 19:47, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · WorldObject functions
Version: WAR 1.4.8

Moves a window once to the screen position of a world object.

MoveWindowToWorldObject(windowName, worldObjectId, heightScale)

Arguments

windowName
string – Name of the window to move.
worldObjectId
number – ID of the world object.
heightScale
number – Factor applied to the object's height value. 0 uses the object's base position; 1.0 raises the point by the full height value (the stock chat bubbles use 1.0).

Returns

Nothing.

Details

  • Unlike AttachWindowToWorldObject, this places the window only once. Call it again (the stock chat manager does so on every update) to keep the window on the object.
  • If the object does not exist, nothing happens.
  • For player objects the point is taken from the character's model when one is available, with its height multiplied by heightScale.
  • The window is shown when the point is on screen and hidden when it is not.
  • When the point is on screen, the window is moved so that it is centred horizontally on the point with its bottom edge on the point, then kept inside the screen.
  • The function needs at least three arguments and only reads the last three.

Errors

  • Error in function call 'MoveWindowToWorldObject': window %s does not exist

Example

Keeping a chat bubble above its speaker, from default/ea_chatsystem/source/chatmanager.lua:

MoveWindowToWorldObject( "ChatBubbleWindow"..group, ChatManager.chatBubbleGroups[group].worldObject, 1.0 )

See also