<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://agiwiki.sierrahelp.com//index.php?action=history&amp;feed=atom&amp;title=Reposition</id>
	<title>Reposition - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://agiwiki.sierrahelp.com//index.php?action=history&amp;feed=atom&amp;title=Reposition"/>
	<link rel="alternate" type="text/html" href="http://agiwiki.sierrahelp.com//index.php?title=Reposition&amp;action=history"/>
	<updated>2026-09-21T21:19:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>http://agiwiki.sierrahelp.com//index.php?title=Reposition&amp;diff=13026&amp;oldid=prev</id>
		<title>Andrew Korson: Created page with &quot;The &#039;&#039;&#039;reposition&#039;&#039;&#039; command changes the position of a screen object currently drawn on the screen by an amount relative to its current position.  == Syntax ==  reposition(s...&quot;</title>
		<link rel="alternate" type="text/html" href="http://agiwiki.sierrahelp.com//index.php?title=Reposition&amp;diff=13026&amp;oldid=prev"/>
		<updated>2019-04-19T21:44:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;reposition&amp;#039;&amp;#039;&amp;#039; command changes the position of a screen object currently drawn on the screen by an amount relative to its current position.  == Syntax ==  reposition(s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;reposition&amp;#039;&amp;#039;&amp;#039; command changes the position of a screen object currently drawn on the screen by an amount relative to its current position.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
reposition([[screen object|obj]] oA, [[variable|var]] vDX, [[variable|var]] vDY);&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
The position of [[screen object]] &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; is changed to (X + &amp;#039;&amp;#039;&amp;#039;vDX&amp;#039;&amp;#039;&amp;#039;, Y + &amp;#039;&amp;#039;&amp;#039;vDY&amp;#039;&amp;#039;&amp;#039;) where X and Y are its current coordinates. The values of &amp;#039;&amp;#039;&amp;#039;vDX&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;vDY&amp;#039;&amp;#039;&amp;#039; are treated as 8 bit signed numbers (values &amp;amp;gt;= 128 are negative numbers, i.e. 255 = -1, 254 = -2, etc.) Mathematically this is represented as &amp;lt;code&amp;gt;delta = value - 256&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The new location is validated using the [[shuffle]] function.&lt;br /&gt;
&lt;br /&gt;
The [[WinAGI]] compiler allows negative numbers to be assigned to [[variable|variables]] to facilitate use of the &amp;#039;&amp;#039;&amp;#039;reposition&amp;#039;&amp;#039;&amp;#039; command. The negative number is automatically converted to the correct unsigned 8-bit value. Other AGI compilers may not support this feature.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;reposition&amp;#039;&amp;#039;&amp;#039; command erases the [[screen object]] from its old location before redrawing it in its new location.&lt;br /&gt;
&lt;br /&gt;
This command can be executed on a [[screen object]] that has been [[animate.obj|initialized]] but not yet [[draw|drawn]]. In this case it will reposition the object without redrawing it.&lt;br /&gt;
&lt;br /&gt;
Use the &amp;#039;&amp;#039;&amp;#039;[[reposition.to]]&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;[[reposition.to.v]]&amp;#039;&amp;#039;&amp;#039; commands to change an object&amp;#039;s position using absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
== Possible Errors ==&lt;br /&gt;
&lt;br /&gt;
AGI does not check that object number &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; is a valid [[screen object]]. If it is not, this command will overwrite other data on the [[memory heap]], which may cause unexpected results, including possibly [[crashing AGI]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;agi&amp;quot;&amp;gt;&lt;br /&gt;
[ move an object down 32 pixels, over 8 pixels&lt;br /&gt;
v255 = 8;&lt;br /&gt;
v201 = 0;&lt;br /&gt;
v201 = v201 - v255;  [ convert to negative value&lt;br /&gt;
v255 = 32;&lt;br /&gt;
v202 = 0;&lt;br /&gt;
v202 = v202 - v255;  [ convert to negative value&lt;br /&gt;
reposition(o4, v201, v202);  [ make the move&lt;br /&gt;
&lt;br /&gt;
[ in WinAGI you can do this:&lt;br /&gt;
v201 = -8;&lt;br /&gt;
v202 = -32;&lt;br /&gt;
reposition(o4, v201, v202);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technical Information ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; width=&amp;quot;200&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Required Interpreter Version:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| width=&amp;quot;175&amp;quot; | Available in all AGI versions.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Byte-Code Value:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| 40 (0x28 hex)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[position]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[position.v]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[reposition.to]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[reposition.to.v]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Category:Commands]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrew Korson</name></author>
	</entry>
</feed>