<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AMoveWindowToWorldObject</id>
	<title>API:MoveWindowToWorldObject - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AMoveWindowToWorldObject"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:MoveWindowToWorldObject&amp;action=history"/>
	<updated>2026-10-17T11:51:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:MoveWindowToWorldObject&amp;diff=30615&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:MoveWindowToWorldObject&amp;diff=30615&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:23Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=WorldObject}}&lt;br /&gt;
Moves a window once to the screen position of a world object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MoveWindowToWorldObject(windowName, worldObjectId, heightScale)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;windowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the window to move.&lt;br /&gt;
;worldObjectId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – ID of the world object.&lt;br /&gt;
;heightScale : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Factor applied to the object&amp;#039;s height value. &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; uses the object&amp;#039;s base position; &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; raises the point by the full height value (the stock chat bubbles use &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Unlike [[API:AttachWindowToWorldObject|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.&lt;br /&gt;
* If the object does not exist, nothing happens.&lt;br /&gt;
* For player objects the point is taken from the character&amp;#039;s model when one is available, with its height multiplied by &amp;lt;code&amp;gt;heightScale&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The window is shown when the point is on screen and hidden when it is not.&lt;br /&gt;
* 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.&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;MoveWindowToWorldObject&amp;#039;: window %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Keeping a chat bubble above its speaker, from &amp;lt;code&amp;gt;default/ea_chatsystem/source/chatmanager.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MoveWindowToWorldObject( &amp;quot;ChatBubbleWindow&amp;quot;..group, ChatManager.chatBubbleGroups[group].worldObject, 1.0 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:AttachWindowToWorldObject|AttachWindowToWorldObject]]&lt;br /&gt;
* [[API:WorldToScreen|WorldToScreen]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>