VisionaireObject Command: getRect

From The Official Visionaire Studio: Adventure Game Engine Wiki

Returns the rectangle values of a VisionaireObject field.


Syntax

getRect(field)


Parameters

Parameter Type Description
field integer The field which specifies a rectangle. The field type must be "t_rect".

Specify the field constant name (V + object table name in singular + field name) or the field id, see the example.


Return values

Type/Structure Description
table x (int) x coordinate of the top left corner of the rectangle stored in the field
y (int) y coordinate of the top left corner of the rectangle stored in the field
width (int) width of the rectangle stored in the field
height (int) height of the rectangle stored in the field


Examples

Example 1: Get the rectangle where the action text is displayed.

-- Specify the field constant name or the field id
local actxt_rect = game:getRect(VGameActionTextRect)
local actxt_rect = game:getRect(590)

-- The shorthand notation offers a more convenient way to achieve the same
local actxt_rect = game.ActionTextRect