Fence.mouse

From AGI Wiki
Revision as of 16:59, 30 March 2019 by Andrew Korson (talk | contribs) (Created page with "The '''fence.mouse''' command restricts the mouse to a portion of the screen. == Syntax == fence.mouse(byt X1, byt Y1, byt X...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The fence.mouse command restricts the mouse to a portion of the screen.

Syntax

fence.mouse(byt X1, byt Y1, byt X2, byt Y2);

Remarks

This command sets up a 'fence' which the mouse cursor cannot go out of, bounded by (X1, Y1) - (X2, Y2).


Possible Errors

NOTE: In the PC version of AGI, this command points to a null function, but the null function does not accept arguments. If you use this command on a PC, AGI will treat the argument values intended for this command as the byte value for the next command, which will almost always crash AGI. Do NOT use this command if you intend to run your game on a PC platform.

Example

Code:

<syntaxhighlight lang="agi"> fence.mouse(1, 1, 50, 50); [ on a PC, this will crash AGI </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in version 3.002.098 and above.
Byte-Code Value: 179 (0xB3 hex)

See Also