lua_gettop equivalent. Returns the number of elements in the stack, which
is also the index of the top element. Notice that a negative index -x is
equivalent to the positive index gettop - x + 1.
Push the ScriptedInvocation userdata that backs a Luau listener
action's performAction(self, listenerContext) for gamepad records.
kind is 0 (connected), 1 (event), or 2 (disconnected) and selects
which ListenerInvocation variant the script sees via isGamepad* /
asGamepad*. changeKind, changeIndex, and changeValue are only
consumed when kind is event.
Creates a GPUCanvas and pushes it onto the Lua stack.
Returns 1 on success, pushes nil and returns 1 on failure.
The canvas is a 1× presentation target only; MSAA color + depth
are user-allocated via GPUTexture.new and passed in the
canvas:beginRenderPass(desc) descriptor.
Push the Lua userdata expected by a ScriptedDrawable's
gamepadConnected / gamepadEvent / gamepadDisconnected method.
kind is 0 (connected), 1 (event), or 2 (disconnected). changeKind,
changeIndex, and changeValue are only consumed when kind is event.
Looks up a shader by name from the per-VM ScriptingContext (editor) or
file assets (runtime) and pushes the ScriptedShader onto the stack.
Returns 1 on success, 0 if not found or compile failed.
lua_rawgetfield equivalent. Pushes onto the stack tk, where t is the
table at the given index. The access is raw, that is, it does not invoke
the __index metamethod. Returns the type of the pushed value.
lua_rawgeti equivalent. Pushes onto the stack the value tn, where t is
the table at the given index. The access is raw, that is, it does not
invoke the __index metamethod. Returns the type of the pushed value.
lua_unref equivalent. Stores the value at idx in the registry and returns
an integer id to unref and get it. This is a strong reference, the object
will not get garbage collected until it is unreffed.
Removes the element at the given valid index, shifting down the elements
above this index to fill the gap. Cannot be called with a pseudo-index,
because a pseudo-index is not an actual stack position.
Moves the top element into the given valid index without shifting any
element (therefore replacing the value at that given index), and then pops
the top element.
Store a generator ref in the scripting context, keyed by asset ID.
This allows ScriptAsset::initScriptedObjectWith() to look up refs
without needing to serialize/deserialize through genRuntimeFile.
Pushes onto the stack a string identifying the current position of the
control at level level in the call stack. Typically this string has the
following format: chunkname:currentline:
Adopt a ScriptingVM created by C++ requestVM. Replaces the C++ scripting
context with one compatible with Dart (factory + console callback).
On web, renderTexture provides the GL context handle for this VM.