<?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%3AWindowStartPositionAnimation</id>
	<title>API:WindowStartPositionAnimation - 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%3AWindowStartPositionAnimation"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowStartPositionAnimation&amp;action=history"/>
	<updated>2026-10-18T01:23:07Z</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:WindowStartPositionAnimation&amp;diff=30913&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:WindowStartPositionAnimation&amp;diff=30913&amp;oldid=prev"/>
		<updated>2026-10-16T19:52:10Z</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=Window}}&lt;br /&gt;
Starts an animation that moves a window between two positions relative to its parent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowStartPositionAnimation(windowName, animationType, startX, startY, endX, endY, duration, setStartBeforeDelay, delay, loopCount)&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.&lt;br /&gt;
;animationType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – How the position changes over time. Use a &amp;lt;code&amp;gt;Window.AnimationType&amp;lt;/code&amp;gt; constant; see [[API:WindowStartAlphaAnimation|WindowStartAlphaAnimation]] for the list.&lt;br /&gt;
;startX, startY : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Start offset of the window&amp;#039;s top-left corner from its parent&amp;#039;s top-left corner, in screen pixels.&lt;br /&gt;
;endX, endY : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – End offset, in screen pixels.&lt;br /&gt;
;duration : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Length of one pass from start to end, in seconds.&lt;br /&gt;
;setStartBeforeDelay : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to move the window to the start position straight away, during the delay. See Details for what &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; does.&lt;br /&gt;
;delay : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Seconds to wait before the animation starts.&lt;br /&gt;
;loopCount : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – For &amp;lt;code&amp;gt;LOOP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;REPEAT&amp;lt;/code&amp;gt;: how many passes to run. 0 runs until stopped.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The animation types, the delay, the loop count and the reset at the end work as described on [[API:WindowStartAlphaAnimation|WindowStartAlphaAnimation]]. X and Y are animated separately with the same settings.&lt;br /&gt;
* The positions are in screen pixels. They are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; multiplied by the window&amp;#039;s scale, unlike the values of [[API:WindowSetOffsetFromParent|WindowSetOffsetFromParent]]. The stock alert text window multiplies the result of [[API:WindowGetOffsetFromParent|WindowGetOffsetFromParent]] by the interface scale before using it here (see the example).&lt;br /&gt;
* &amp;quot;Original position&amp;quot; for the resetting types is the window&amp;#039;s offset from its parent when the animation was started.&lt;br /&gt;
* Unlike the alpha and scale animations, the value used before the animation starts is not the window&amp;#039;s current position but (0, 0). With a &amp;lt;code&amp;gt;delay&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;setStartBeforeDelay = false&amp;lt;/code&amp;gt;, the window therefore sits at its parent&amp;#039;s top-left corner until the delay is over. Pass &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to avoid this.&lt;br /&gt;
* Each frame the new offset is applied the same way as a moved window, so the client may keep the window on screen (see [[API:WindowIsSticky|WindowIsSticky]]).&lt;br /&gt;
* The window&amp;#039;s anchors are not removed. The stock UI clears and re-adds anchors around position animations; its comment says &amp;#039;&amp;#039;&amp;quot;animation ignores the anchors&amp;quot;&amp;#039;&amp;#039;.&lt;br /&gt;
* A window has at most one position animation. Starting a new one stops the old one first.&lt;br /&gt;
* &amp;lt;code&amp;gt;animationType&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;loopCount&amp;lt;/code&amp;gt; are truncated to whole numbers.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowStartPositionAnimation&amp;#039;: Window %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowStartPositionAnimation&amp;#039;: Window %s is currently locked and may not be modified from lua. ...&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This check never triggers in the current client. See [[API:WindowSetShowing|WindowSetShowing]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Sliding an alert upwards, from &amp;lt;code&amp;gt;ea_alerttextwindow/source/alerttextwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- Get where we are&lt;br /&gt;
local x, y = WindowGetOffsetFromParent( oldestWindowName )&lt;br /&gt;
WindowStopPositionAnimation( oldestWindowName )&lt;br /&gt;
&lt;br /&gt;
-- reset the anchor for the oldest window&lt;br /&gt;
-- because animation ignores the anchors&lt;br /&gt;
WindowClearAnchors( oldestWindowName )&lt;br /&gt;
WindowAddAnchor( oldestWindowName, &amp;quot;top&amp;quot;, &amp;quot;Root&amp;quot;, &amp;quot;top&amp;quot;, 0, y )&lt;br /&gt;
&lt;br /&gt;
local uiScale = InterfaceCore.GetScale()&lt;br /&gt;
x = uiScale * x&lt;br /&gt;
y = uiScale * y&lt;br /&gt;
&lt;br /&gt;
local targetY = y - AlertTextWindow.NewestHeight&lt;br /&gt;
WindowStartPositionAnimation(   oldestWindowName,&lt;br /&gt;
                                Window.AnimationType.SINGLE_NO_RESET,&lt;br /&gt;
                                x,&lt;br /&gt;
                                y,&lt;br /&gt;
                                x,&lt;br /&gt;
                                targetY,&lt;br /&gt;
                                AlertTextWindow.ANIMATION_DATA.duration,&lt;br /&gt;
                                true, 0, 0 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowStopPositionAnimation|WindowStopPositionAnimation]]&lt;br /&gt;
* [[API:WindowStartAlphaAnimation|WindowStartAlphaAnimation]]&lt;br /&gt;
* [[API:WindowSetOffsetFromParent|WindowSetOffsetFromParent]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>