Reposition.to.v
The reposition.to.v command indirectly changes the position of a screen object that is currently drawn on the screen.
Syntax
reposition.to.v(obj oA, var vX, var vY);
Remarks
The position of screen object oA is changed to (vX, vY). The new location is validated using the shuffle function.
The reposition.to.v command erases the object from its old location before redrawing it in its new location.
This command can be executed on screen object that has been initialized but not yet drawn, in which case it functions exactly the same as the position.v command.
The reposition.to.v command is functionally equivalent to calling the erase command followed by the position.v command.
To change the position of a screen object relative to its current position, use the reposition command.
Possible Errors
AGI does not check that object number oA 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.
Example
<syntaxhighlight lang="agi">
- define wizard o2
... [ initialize and draw object if(said("teleport"))
{ v201 = 90; v202 = 78; reposition.to.v(wizard, v201, v202); }
</syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 148 (0x94 hex) |