Difference between revisions of "AGIWiki/block"
< AGIWiki
Jump to navigation
Jump to search
m (Created page with "__NOTOC__ {{AGIWiki}} The '''block''' command programmatically creates an invisible rectangular block to restrict screen object movement. block([[...") |
(No difference)
|
Revision as of 09:45, 25 January 2015
The block command programmatically creates an invisible rectangular block to restrict screen object movement.
block(number left, number top, number right, number bottom);
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
left
: a number, 0-255, specifying the x-coordinate of the left side of the block rectangle, in graphics coordinatestop
: a number, 0-255, specifying the y-coordinate of the top side of the block rectangle, in graphics coordinatesright
: a number, 0-255, specifying the x-coordinate of the right side of the block rectangle, in graphics coordinatesbottom
: a number, 0-255, specifying the y-coordinate of the bottom side of the block rectangle, in graphics coordinates
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): <syntax type = "C++">
block(10, 25, 100, 120);
</syntax>
Technical Information
Required interpreter version | Available in all AGI versions |
Bytecode value | 90 (0x5A hex) |
See also
Sources
- AGI Studio help file
- WinAGI help file