Difference between revisions of "Get.posn"
From AGI Wiki
Jump to navigationJump to search (Created page with "get.posn == <br />Syntax == <blockquote><code>get.posn(oA,vX,vY);</code></blockquote> == <br />Description == vX and vY are set to the X and Y co-ordinates of obje...") |
|||
Line 1: | Line 1: | ||
− | get.posn | + | The '''get.posn''' command copies a screen object's current X and Y position values into variables. |
− | + | == Syntax == | |
− | + | get.posn([[screen object|obj]] oA, [[variable|var]] vX, [[variable|var]] vY); | |
− | + | == Remarks == | |
− | + | [[Variable|Variables]] '''vX''' and '''vY''' are set to the current coordinates of [[screen object]] '''oA'''. | |
− | + | == Possible Errors == | |
− | + | AGI does not check that object number '''oA''' is a valid object. If it is not, the returned values will be meaningless. | |
− | + | If the object has not yet been positioned, the results will be meaningless. | |
− | == | + | == Example == |
− | + | <div class="CodeBlockHeader">Code:</div> | |
+ | <syntaxhighlight lang="agi"> | ||
+ | get.posn(o1, v51, v52); | ||
+ | print("Object position is %v51, %v52"); | ||
+ | </syntaxhighlight> | ||
− | + | == Technical Information == | |
− | [[ | + | {| border="1" cellpadding="2" |
− | [[Category: | + | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' |
+ | | width="175" | Available in all AGI versions. | ||
+ | |- | ||
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 39 (0x27 hex) | ||
+ | |} | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | '''[[position]]'''<br /> | ||
+ | '''[[position.v]]'''<br /> | ||
+ | '''[[reposition]]'''<br /> | ||
+ | '''[[reposition.to]]'''<br /> | ||
+ | '''[[reposition.to.v]]'''<br /> | ||
+ | [[Category:Commands]]<br /> |
Latest revision as of 21:26, 1 April 2019
The get.posn command copies a screen object's current X and Y position values into variables.
Syntax
get.posn(obj oA, var vX, var vY);
Remarks
Variables vX and vY are set to the current coordinates of screen object oA.
Possible Errors
AGI does not check that object number oA is a valid object. If it is not, the returned values will be meaningless.
If the object has not yet been positioned, the results will be meaningless.
Example
Code:
<syntaxhighlight lang="agi"> get.posn(o1, v51, v52); print("Object position is %v51, %v52"); </syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 39 (0x27 hex) |
See Also
position
position.v
reposition
reposition.to
reposition.to.v