Animate.obj

From AGI Wiki
Jump to navigationJump to search

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 only o0-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 through o15 are valid; if you specify o16, then this error will occur)

Example

Code:
// 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);

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.