Scaleform
Simple and easy-to-use module for Scaleform GUI.
You can use it as a separate resource or just add the file to your client_scripts
.
Usage Example
local buttons = {
{ input = '~INPUT_CELLPHONE_LEFT~', text = "Previous Player" },
{ input = '~INPUT_CELLPHONE_RIGHT~', text = "Next Player" },
}
local scaleform = Scaleform:Request('INSTRUCTIONAL_BUTTONS')
for i = 1, #buttons do
scaleform:Call('SET_DATA_SLOT', i - 1, buttons[i].input, buttons[i].text)
end
scaleform:Call('DRAW_INSTRUCTIONAL_BUTTONS')
while true do
Citizen.Wait(0)
scaleform:RenderFullscreen()
end
API
Scaleform:Request(id) -- async
Scaleform:Delete()
Scaleform:Call(func, ...) -- use string, number or boolean parameters
Scaleform:Render(x, y, w, h, r, g, b, a)
Scaleform:RenderFullscreen(r, g, b, a)
Scaleform:RenderTimed(ms, x, y, w, h, r, g, b, a) -- async
Scaleform:RenderFullscreenTimed(ms, r, g, b, a) -- async
Helpful Resources
Scaleform Wiki
Scaleforms + Functions List