../
kernel
functions
add
all
apply_delta
assert
atan2
btn
btnp
camera
cd
char
chooser
circ
circfill
clip
cls
color
cos
count
cp
create_delta
create_gui
create_process
cursor
date
del
deli
env
error
exit
fetch
fetch_metadata
fget
fillp
foreach
fset
fstat
fullpath
get_clipboard
get_display
get_draw_target
get_spr
include
input
key
keyp
line
ls
map
max
memcpy
memmap
memset
menuitem
mget
mkdir
mouse
mouselock
mset
music
mv
note
on_event
open
oval
ovalfill
peek
peek2
peek4
peek8
peektext
pget
pid
pod
poke
poke2
poke4
poke8
printh
pset
pwd
readtext
rect
rectfill
rm
rrect
rrectfill
scoresub
send_message
set_clipboard
set_draw_target
set_spr
sfx
sin
socket
split
spr
sspr
stat
stop
store
store_metadata
sub
time
tokenoid
type
unmap
unpod
userdata
vec
vid
window
vec(...): ud
Overview
The vec function is one of two ways to create a new userdata from scratch, with the other being the userdata function. Produces a new f64 typed 1D userdata populated with each of the arguments.
Arguments
...: number|nil
Each value to populate the userdata with. The number of arguments dictates the width of the produced userdata. Defaults to 0.
Returns
ud: userdata|nil
The userdata produced, or nil if no arguments were provided.
Example
local position = vec(12, 19)
?position:get(0) -- 12
?position:get(1) -- 19