Difference between revisions of "AGIWiki/block"

From ScummVM :: Wiki
Jump to navigation Jump to search
m (Text replacement - "</source>" to "</syntaxhighlight>")
m (Text replacement - "<source lang=" to "<syntaxhighlight lang=")
 
Line 31: Line 31:
  
 
The following code creates a block rectangle whose top-left corner is at (10, 25) and whose bottom-right corner is at (100, 120):
 
The following code creates a block rectangle whose top-left corner is at (10, 25) and whose bottom-right corner is at (100, 120):
<source lang="cpp">
+
<syntaxhighlight lang="cpp">
 
  block(10, 25, 100, 120);
 
  block(10, 25, 100, 120);
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 15:13, 25 October 2018

AGIWiki


Object and View Commands

The block command programmatically creates an invisible rectangular block to restrict screen object movement.

Syntax

block(byt left, byt top, byt right, byt bottom);

Remarks

AGI expects the coordinates to be in upper-left to lower-right format. left must be less than or equal to right and top must be less than or equal to bottom, or the test will always fail. Objects on the screen are not allowed to cross the borders of the block (regardless of whether they are inside the block or outside), unless an ignore.blocks command has been issued for that object.

Note: There can be only one block on the screen at a time. If the block command is issued when a block already exists, the new block will replace the old one.

The unblock command will remove the block without replacing it with a new one.

Parameters

Possible errors

(Unknown)

Examples

The following code creates a block rectangle whose top-left corner is at (10, 25) and whose bottom-right corner is at (100, 120):

 block(10, 25, 100, 120);

Technical Information

Required interpreter version Available in all AGI versions
Bytecode value 90 (0x5A hex)

See also

Sources