Difference between revisions of "Release.priority"

From AGI Wiki
Jump to navigationJump to search
 
(17 intermediate revisions by one other user not shown)
Line 1: Line 1:
release.priority(n);
+
The '''release.priority''' command restores automatic priority assignment based on a screen object's position.
  
Turns on the automatic priority choice for the [[object|object n]]. The priority is set depending on the vertical coordinate of the object. This way, as an object moves down it approaches the viewer. See section [[Priority bands]] and control lines for a table of y coordinates and the associated priorities.
+
== Syntax ==
  
<blockquote>
+
release.priority([[screen object|obj]] oA);
{| border="1px"
+
 
|
+
== Remarks ==
{| width="200px" border="0px" <!-- class="wikitable" -->
+
 
|- style="background-color: #F2F2F2;"
+
The default behavior for [[screen objects]] is to automatically assign [[priority]] based on position. The '''[[set.priority]]''' command assigns a static priority value and disables the automatic priority assignment.
!align="center"|<!!align="center"|y!!align="center"|<!!align="center"|priority
+
 
|-
+
The '''release.priority''' command restores normal behavior to [[screen object]] '''oA'''. AGI will change the priority of screen object '''oA''' to match its current position at the end of the current [[interpreter cycle]].
|align="center"|0||&nbsp;||align="center"|48||align="center"|4
+
 
|-
+
If the screen object already assigns priority based on position, '''release.loop''' has no effect.
|align="center"|48||&nbsp;||align="center"|60||align="center"|5
+
 
|-
+
== Possible Errors ==
|align="center"|60||&nbsp;||align="center"|72||align="center"|6
+
 
|-
+
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]].
|align="center"|72||&nbsp;||align="center"|84||align="center"|7
+
 
|-
+
== Example ==
|align="center"|84||&nbsp;||align="center"|96||align="center"|8
 
|-
 
|align="center"|96||&nbsp;||align="center"|108||align="center"|9
 
|-
 
|align="center"|108||&nbsp;||align="center"|120||align="center"|10
 
|-
 
|align="center"|120||&nbsp;||align="center"|132||align="center"|11
 
|-
 
|align="center"|132||&nbsp;||align="center"|144||align="center"|12
 
|-
 
|align="center"|144||&nbsp;||align="center"|156||align="center"|13
 
|-
 
|align="center"|156||&nbsp;||align="center"|168||align="center"|14
 
|}
 
|}
 
  
{|
+
<div class="CodeBlockHeader">Code:</div>
|<pre>
+
<syntaxhighlight lang="agi">
< y < priority
+
set.priority(o1, 15); [ priority won't change if object position changes
0 48 4
+
...
48 60 5
+
release.priority(o1); [ restore automatic priority assignment
60 72 6
+
</syntaxhighlight>
72 84 7
 
84 96 8
 
96 108 9
 
108 120 10
 
120 132 11
 
132 144 12
 
144 156 13
 
156 168 14
 
</pre>
 
|}
 
  
This way, as an object moves down it approaches the viewer.
+
== Technical Information ==
</blockquote>
 
  
 +
{| border="1" cellpadding="2"
 +
| style="background-color: #efefef" width="200" | '''Required Interpreter Version:'''
 +
| width="175" | Available in all AGI versions.
 +
|-
 +
| style="background-color: #efefef" | '''Byte-Code Value:'''
 +
| 55 (0x37 hex)
 +
|}
  
 +
== See Also ==
  
[[AGI_Command_Reference_-_Object_Description_Commands#release.priority.28n.29.3B]]
+
'''[[set.priority]]'''<br />
 +
'''[[set.priority.v]]'''<br />
 +
[[Category:Commands]]<br />

Latest revision as of 15:45, 19 April 2019

The release.priority command restores automatic priority assignment based on a screen object's position.

Syntax

release.priority(obj oA);

Remarks

The default behavior for screen objects is to automatically assign priority based on position. The set.priority command assigns a static priority value and disables the automatic priority assignment.

The release.priority command restores normal behavior to screen object oA. AGI will change the priority of screen object oA to match its current position at the end of the current interpreter cycle.

If the screen object already assigns priority based on position, release.loop has no effect.

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

Code:

<syntaxhighlight lang="agi"> set.priority(o1, 15); [ priority won't change if object position changes ... release.priority(o1); [ restore automatic priority assignment </syntaxhighlight>

Technical Information

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

See Also

set.priority
set.priority.v