Difference between revisions of "VisionaireObject Command: getPoint"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Returns the point values of a VisionaireObject field. == Syntax == <syntaxhighlight lang="lua"> getPoint(field) </syntaxhighlight> == Parameters == {| class="ts" |- ! sty...")
 
(No difference)

Latest revision as of 21:03, 11 August 2023

Returns the point values of a VisionaireObject field.


Syntax

getPoint(field)


Parameters

Parameter Type Description
field integer The field which specifies a point. The field type must be "t_point".

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 point stored in the field
y (int) y coordinate of the point stored in the field


Examples

Example 1: Get the position of a currently running animation.

-- Specify the field constant name or the field id
local anim_pos = getObject("ActiveAnimations[cat]"):getPoint(VAnimationCurrentPosition)
local anim_pos = getObject("ActiveAnimations[cat]"):getPoint(496)

-- The shorthand notation offers a more convenient way to achieve the same
local anim_pos = ActiveAnimations["cat"].CurrentPosition