Vector.create

From GiderosMobile
Revision as of 08:52, 1 February 2026 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2026.1<br/> '''Class:''' vector library<br/> === Description === Creates a new vector with the given component values. <syntaxhig...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2026.1
Class: vector library

Description

Creates a new vector with the given component values.

(table) = vector.create(x,y[,z])

The third (z) component is set to 0 if it is not defined.

Parameters

x: (number) the x component value
y: (number) the y component value
z: (number) the z component value optional

Return values

Returns (table) the vector coordinate values

Example

local vec = vector.create(1, 2, 3)
print(vec) -- 1, 2, 3
local vec2 = vector.create(1, 2)
print(vec2) -- 1, 2, 0