Difference between revisions of "Animate.obj"
m (Collector moved page Animate.obj(); to Animate.obj over redirect) |
|||
Line 11: | Line 11: | ||
* if you specify an [[Animated Object|object]] that is outside the range specified in the [[OBJECT File]], the game will crash with a [[bad object number error]] (note: in the AGI Studio Template Game, the maximum number of objects is 16, meaning that <code>o0</code> through <code>o15</code> are valid; if you specify <code>o16</code>, then this error will occur) | * if you specify an [[Animated Object|object]] that is outside the range specified in the [[OBJECT File]], the game will crash with a [[bad object number error]] (note: in the AGI Studio Template Game, the maximum number of objects is 16, meaning that <code>o0</code> through <code>o15</code> are valid; if you specify <code>o16</code>, then this error will occur) | ||
− | == | + | == Example == |
− | |||
− | |||
− | |||
<div class="CodeBlockHeader">Code:</div> | <div class="CodeBlockHeader">Code:</div> | ||
<syntaxhighlight lang="agi"> | <syntaxhighlight lang="agi"> | ||
− | + | // basic steps needed to create | |
− | + | // and display a screen object | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | //basic steps needed to create | ||
− | //and display a screen object | ||
animate.obj(o2); | animate.obj(o2); | ||
load.view(4); | load.view(4); | ||
Line 33: | Line 22: | ||
draw(o2); | draw(o2); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
== Syntax == | == Syntax == |
Revision as of 19:03, 21 March 2019
The animate.obj command tells the interpreter to activate the specified object. An object must be activated in the current room before it can be used.
animate.obj(object);
Parameters
object
: an object,o0-o255;
this object will be activated for use (note: the AGI Studio Template Game supports onlyo0-o15
)
Possible errors
- if you specify an object that is outside the range specified in the OBJECT File, the game will crash with a bad object number error (note: in the AGI Studio Template Game, the maximum number of objects is 16, meaning that
o0
througho15
are valid; if you specifyo16
, then this error will occur)
Example
<syntaxhighlight lang="agi"> // basic steps needed to create // and display a screen object animate.obj(o2); load.view(4); set.view(o2,4); position(o2,80,120); draw(o2); </syntaxhighlight>
Syntax
- animate.obj(obj oA);
Remarks
If the object number exceeds the max screen object count, AGI will generate an error.
Screen objects must be activated with the animate.obj command before it can be used in any other commands. Attempting to run commands on an uninitialized screen object will generate a runtime error.
If you call the animate.obj command on an object that is already activated, the command is ignored.
Technical Information
Required interpreter version | Available in all AGI versions |
Bytecode value | 33 (0x21 hex) |
See also
Sources
Some of the text in this article comes from the AGI Studio help file.