VisionaireObject Command: getSprites

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 17:10, 31 August 2023 by EK (talk | contribs) (Created page with "Returns a table containing multiple sprite values (tables containing the elements '''path''', '''position''', '''transparency''', '''transpcolor''' and '''pause'''). == Synt...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns a table containing multiple sprite values (tables containing the elements path, position, transparency, transpcolor and pause).


Syntax

getSprites(field)


Parameters

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

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_sprite values linked in the field


Examples

Example 1: Get all sprites of an animation.

-- Specify the field constant name or the field id
local anim_sprts = getObject("Animations[waterfall]"):getSprites(VAnimationSprites)
local anim_sprts = getObject("Animations[waterfall]"):getSprites(235)

-- The shorthand notation offers a more convenient way to achieve the same
local anim_sprts = Animations["waterfall"].Sprites