Difference between revisions of "VisionaireObject Command: getRects"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Returns a table containing multiple rectangle values (x, y, width, height tables). == Syntax == <syntaxhighlight lang="lua"> getRects(field) </syntaxhighlight> == Paramete...")
 
 
Line 1: Line 1:
Returns a table containing multiple rectangle values (x, y, width, height tables).
+
Returns a table containing multiple rectangle values (tables containing the elements '''x''', '''y''', '''width''', '''height''').
  
  

Latest revision as of 17:11, 31 August 2023

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


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