The "device_mouse_check_region" Function
Syntax#
| Argument | Type | Description |
|---|---|---|
device | integer | The mouse or touch point to check, where 0 is first |
x | real | The horizontal room coordinate for the region to check |
y | real | The horizontal room coordinate for the region to check |
rot | real | The rotation of the region to check, if rectangular |
width | real | The width (or radius) in pixels of the region to check |
[height] | real | Optional: The height in pixels of the region to check (use none for circular) |
[halign] | constant | Optional: The horizontal alignment of the region to check (use none for fa_center) |
[valign] | constant | Optional: The vertical alignment of the region to check (use none for fa_middle) |
Description#
Checks whether the mouse is currently within a certain region relative to room coordinates and returns true or false. If only a region width is specified, it will be interpreted as a radius and the region to check will be circular. For other shapes, a rotated rectangle can be used to cover most areas.
By default, the region to check will be aligned to the center, but this can be changed by specifying optional halign and valign values using font alignment constants such as fa_left and fa_top. Alignment must be input as a pair.

X1