Difference between revisions of "Animate.obj"

From AGI Wiki
Jump to navigationJump to search
(Created page with "The '''animate.obj''' command activates a screen object. == Syntax == : animate.obj(obj oA); == Remarks == If the object number exceeds the Screen obj...")
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''animate.obj''' command activates a screen object.
+
The '''animate.obj''' command initializes a [[screen object]] so it can be used on screen.
  
 
== Syntax ==
 
== Syntax ==
  
: animate.obj([[Screen objects|obj]] oA);
+
animate.obj([[screen object|obj]] oA);
  
 
== Remarks ==
 
== Remarks ==
  
If the object number exceeds the [[Screen objects#Maximum screen objects|max screen object]] count, AGI will generate an error.
+
[[Screen object|Screen objects]] must be initialized with the '''animate.obj''' command before they can be used in any other commands. When a [[screen object]] is initialized it is enabled for [[updating]] and [[cycling]] by default. If you call the '''animate.obj''' command on an object that is already initialized, the command is ignored.
  
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 uninitialize screen object will generate a runtime error.
+
== Possible Errors ==
  
If you call the '''animate.obj''' command on an object that is already activated, the command is ignored.
+
If the object number exceeds the [[max screen object]] count, AGI will raise [[trappable error #13]].
 +
 
 +
Most commands that are run on an uninitialized screen objects are just ignored by AGI, but some of them can result in interactions with invalid data.
  
 
== Example ==
 
== Example ==
Line 17: Line 19:
 
<div class="CodeBlockHeader">Code:</div>
 
<div class="CodeBlockHeader">Code:</div>
 
<syntaxhighlight lang="agi">
 
<syntaxhighlight lang="agi">
//basic steps needed to create
+
[ basic steps needed to create
//and display a screen object
+
[ and display a screen object
 
animate.obj(o2);
 
animate.obj(o2);
 
load.view(4);
 
load.view(4);
Line 26: Line 28:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
&nbsp;
 
 
== Technical Information ==
 
== Technical Information ==
  
 
{| border="1" cellpadding="2"
 
{| border="1" cellpadding="2"
| style="background-color: #efefef" | '''Required interpreter version'''
+
| style="background-color: #efefef" width="200" | '''Required Interpreter Version:'''
| Available in all AGI versions
+
| width="175" | Available in all AGI versions.
 
|-
 
|-
| style="background-color: #efefef" | '''Bytecode value'''
+
| style="background-color: #efefef" | '''Byte-Code Value:'''
 
| 33 (0x21 hex)
 
| 33 (0x21 hex)
 
|}
 
|}
  
[[Category:Logic Commands]]
+
== See Also ==
[[Category:Object and View Commands]]
+
 
 +
[[Screen Object/View Commands]]<br />
 +
[[Working with Screen Objects]]<br />
 +
 
 +
[[Category:Commands]]

Latest revision as of 17:05, 23 March 2019

The animate.obj command initializes a screen object so it can be used on screen.

Syntax

animate.obj(obj oA);

Remarks

Screen objects must be initialized with the animate.obj command before they can be used in any other commands. When a screen object is initialized it is enabled for updating and cycling by default. If you call the animate.obj command on an object that is already initialized, the command is ignored.

Possible Errors

If the object number exceeds the max screen object count, AGI will raise trappable error #13.

Most commands that are run on an uninitialized screen objects are just ignored by AGI, but some of them can result in interactions with invalid data.

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);

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 33 (0x21 hex)

See Also

Screen Object/View Commands
Working with Screen Objects