VisionaireObject Command: getRects

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 17:02, 31 August 2023 by EK (talk | contribs) (Created page with "Returns a table containing multiple rectangle values (x, y, width, height tables). == Syntax == <syntaxhighlight lang="lua"> getRects(field) </syntaxhighlight> == Paramete...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns a table containing multiple rectangle values (x, y, width, height tables).


Syntax

getRects(field)


Parameters

Parameter Type Description
field integer The field which specifies a list of rectangle values. The field type must be "t_vrect".

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


Return values

Type Description
table The table of t_rect values linked in the field


Examples

Example 1: Get the savegame areas of a menu scene.

-- Specify the field constant name or the field id
local save_rects = getObject("Scenes[savemenu]"):getRects(VSceneSavegameAreas)
local save_rects = getObject("Scenes[savemenu]"):getRects(322)

-- The shorthand notation offers a more convenient way to achieve the same
local save_rects = Scenes["savemenu"].SavegameAreas