<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.visionaire-tracker.net/index.php?action=history&amp;feed=atom&amp;title=Global_Command%3A_startTween</id>
		<title>Global Command: startTween - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.visionaire-tracker.net/index.php?action=history&amp;feed=atom&amp;title=Global_Command%3A_startTween"/>
		<link rel="alternate" type="text/html" href="https://wiki.visionaire-tracker.net/index.php?title=Global_Command:_startTween&amp;action=history"/>
		<updated>2026-05-25T16:07:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.visionaire-tracker.net/index.php?title=Global_Command:_startTween&amp;diff=11875&amp;oldid=prev</id>
		<title>EK: Created page with &quot;Start tween on a Lua variable. The value of the variable is changed over a certain period of time from a start value to a target value. Tweens are overwritten if they are set...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.visionaire-tracker.net/index.php?title=Global_Command:_startTween&amp;diff=11875&amp;oldid=prev"/>
				<updated>2023-05-03T13:48:36Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Start tween on a Lua variable. The value of the variable is changed over a certain period of time from a start value to a target value. Tweens are overwritten if they are set...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Start tween on a Lua variable. The value of the variable is changed over a certain period of time from a start value to a target value. Tweens are overwritten if they are set again.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;ts&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width:15%&amp;quot; | Related functions&lt;br /&gt;
| [[Global Command: startObjectTween|startObjectTween]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
startTween(target, from, to, duration, easing [, repeat, reverse_repeat])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;ts&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:15%&amp;quot; | Parameter&lt;br /&gt;
! style=&amp;quot;width:15%&amp;quot; | Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| target&lt;br /&gt;
| string&lt;br /&gt;
| Name of the Lua variable to start tweening on.&lt;br /&gt;
|-&lt;br /&gt;
| from&lt;br /&gt;
| integer/float&lt;br /&gt;
| Tween start value&lt;br /&gt;
|-&lt;br /&gt;
| to&lt;br /&gt;
| integer/float&lt;br /&gt;
| Tween target value&lt;br /&gt;
|-&lt;br /&gt;
| duration&lt;br /&gt;
| float&lt;br /&gt;
| Amount of time the tween takes (in milliseconds).&lt;br /&gt;
|-&lt;br /&gt;
| easing&lt;br /&gt;
| integer&lt;br /&gt;
| Type of easing. See the [https://www.visionaire-studio.com/luadocs/lua.html#easing easings enumeration (Luadocs)] for all supported values. Previews for easing types can found on [https://easings.net/ easings.net].&lt;br /&gt;
|-&lt;br /&gt;
| repeat&lt;br /&gt;
| boolean&lt;br /&gt;
| If true the tween starts again from the beginning after reaching the target value, looping infinitely. Default value is false.&lt;br /&gt;
|-&lt;br /&gt;
| reverse_repeat&lt;br /&gt;
| boolean&lt;br /&gt;
| Only applicable if &amp;quot;repeat&amp;quot; is true. If true the tween runs backwards after reaching the target value and forwards again after reaching the start value, pendulum-wise. Default value is false.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Return values ==&lt;br /&gt;
&lt;br /&gt;
none&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
'''Example 1:''' Tween the Lua variable called &amp;quot;myVar&amp;quot; linearly from its initial value of 1 to 10 over a period of 3 seconds. The current value is continuously printed to the log file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
myVar = 1&lt;br /&gt;
startTween(&amp;quot;myVar&amp;quot;, myVar, 10, 3000, easeLinearInOut)&lt;br /&gt;
&lt;br /&gt;
-- Register a function which prints out the current value of &amp;quot;myVar&amp;quot; until 10 is reached&lt;br /&gt;
function printMyVar()&lt;br /&gt;
  print(myVar)&lt;br /&gt;
&lt;br /&gt;
  if myVar &amp;gt;= 10 then&lt;br /&gt;
    unregisterEventHandler(&amp;quot;mainLoop&amp;quot;, &amp;quot;printMyVar&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
registerEventHandler(&amp;quot;mainLoop&amp;quot;, &amp;quot;printMyVar&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{toc}}&lt;/div&gt;</summary>
		<author><name>EK</name></author>	</entry>

	</feed>