Difference between revisions of "Release.priority"

From AGI Wiki
Jump to navigationJump to search
m (Collector moved page Release.priority(); to Release.priority)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
'''<code>release.priority(n);</code>''' turns on the automatic priority choice for the [[Animated 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 [[AGI Specifications: Chapter 2 - Overview#bands|Priority bands and control lines]] for a table of y coordinates and the associated priorities.<br />
+
The '''release.priority''' command restores automatic priority assignment based on a screen object's position.
  
<blockquote>
+
== Syntax ==
{| border="1px" style="background-color: #F9F9F9; border: 1px solid #000000;" cellspacing=0 cellpadding=0
+
 
|
+
release.priority([[screen object|obj]] oA);
{| width="300px" border="0px"
+
 
|- style="background-color: #F2F2F2;"
+
== Remarks ==
!align="center"|<!!align="center"|y!!align="center"|<!!align="center"|priority
+
 
|-
+
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"|0||&nbsp;||align="center"|48||align="center"|4
+
 
|-
+
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"|48||&nbsp;||align="center"|60||align="center"|5
+
 
|-
+
If the screen object already assigns priority based on position, '''release.loop''' has no effect.
|align="center"|60||&nbsp;||align="center"|72||align="center"|6
+
 
|-
+
== Possible Errors ==
|align="center"|72||&nbsp;||align="center"|84||align="center"|7
+
 
|-
+
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"|84||&nbsp;||align="center"|96||align="center"|8
+
 
|-
+
== Example ==
|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
 
|}
 
|}
 
</blockquote><br />
 
  
The effect is that as an object moves down it appears to approaches the player.
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
set.priority(o1, 15); [ priority won't change if object position changes
 +
...
 +
release.priority(o1); [ restore automatic priority assignment
 +
</syntaxhighlight>
  
== <br />See Also ==
+
== Technical Information ==
  
* [[AGI Specifications: Chapter 4 - The_Logic_Language#release.priority]]
+
{| border="1" cellpadding="2"
* [[AGI Command Reference - Object Description Commands#release.priority.28n.29.3B]]
+
| 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)
 +
|}
  
&nbsp;
+
== See Also ==
  
[[Category:Objects]]
+
'''[[set.priority]]'''<br />
[[Category:Object and View Commands]]
+
'''[[set.priority.v]]'''<br />
[[Category:Logic Commands]]
+
[[Category:Commands]]<br />
[[Category:View Resources]]
 

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