VisionaireObject Command: getSprite

From The Official Visionaire Studio: Adventure Game Engine Wiki

Returns the sprite values of a VisionaireObject field.


Syntax

getSprite(field)


Parameters

Parameter Type Description
field integer The field which specifies a sprite. The field type must be "t_sprite".

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 path (str) relative path to the image file stored in the field
position (t_point) sprite offset stored in the field, in case sprite is used in an animation
transparency (int)
transpcolor (int) transparent color
pause (int) pause value of the rectangle stored in the field (in milliseconds), in case the sprite is used in an animation


Examples

Example 1: Get the background sprite of an interface.

-- Specify the field constant name or the field id
local inv_bg = getObject("Interfaces[inventory]"):getSprite(VInterfaceSprite)
local inv_bg = getObject("Interfaces[inventory]"):getSprite(238)

-- The shorthand notation offers a more convenient way to achieve the same
local inv_bg = Interfaces["inventory"].Sprite