The Scaleform class is a wrapper for GTA V scaleform movies, providing a Lua-friendly API to load, render, and interact with scaleform elements. It handles function calls, parameter passing, rendering in both 2D and 3D space, and async return values.
Properties
Name
Type
Description
handle
number
The native handle of the loaded scaleform movie.
name
string
The name of the loaded scaleform (set on creation).
Renders the scaleform in 3D space with additive blending.
Example
-- Request and show a scaleformlocalsf=Scaleform.Request("instructional_buttons")-- Wait until it is loadedwhilenotsf:IsLoaded()doCitizen.Wait(0)end-- Call a functionsf:CallFunction("CLEAR_ALL")sf:CallFunction("TOGGLE_MOUSE_BUTTONS",true)-- Render it full screenCitizen.CreateThread(function()whilesf:IsValid()doCitizen.Wait(0)sf:Render2D()endend)
Notes
Parameters passed to CallFunction can include:
boolean, integer, float
strings (labels, player names, texture names)
tables with { type = “label” or “literal”, data = “…” }
SColor instances (automatically converted to ARGB).
Async functions (CallFunctionAsyncReturnInt/Bool/String) yield until the return value is ready.
Always call Dispose() when finished with a scaleform to free memory.