This is a release specifically for developers, which should help out drastically when using scaleforms.
It is similar to the C# wrapper for scaleforms, but in Lua!
Example code with wrapper (Results in the same image on my scaleform documentation):
Citizen.CreateThread(function()
local s = Scaleform.Request("mp_big_message_freemode")
s:CallFunction("SHOW_SHARD_WASTED_MP_MESSAGE", "SOME TEXT", "SOME MORE TEXT", 5)
while true do
Citizen.Wait(0)
s:Draw2D()
end
end)
Without Wrapper:
Citizen.CreateThread(function()
local scaleform = RequestScaleformMovie("mp_big_message_freemode")
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
end
BeginScaleformMovieMethod(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE")
PushScaleformMovieMethodParameterString("SOME TEXT")
PushScaleformMovieMethodParameterString("SOME MORE TEXT")
PushScaleformMovieMethodParameterInt(5)
EndScaleformMovieMethod()
while true do
Citizen.Wait(0)
DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255)
end
end)
Download it here (comes with an example in the resource, howver can be implemented into any script you wish, or just yoinked into some sort of helper resource):
Great! Been waiting for you to release this, this will definetly speed up and simplify my shitty Scaleform methods! Hopefully we’ll also see more implementations of Scaleform in other releases.
Thanks, a shame really, how little people use them at times, because they can be handy if you for example, arent too good at design, or infact, if you just want to go with that nice native look
Great, when I saw it, I remembered that I had something like this.
In my code scaleform functions are dynamically called(?) based on the type of variable
Is old and not complete because I don’t check if the numbertype is float or int. Maybe someone will find that useful too
function Initialize(scaleform, sub, params)
local scaleform = RequestScaleformMovie(scaleform)
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
end
PushScaleformMovieFunction(scaleform, sub)
for i = 1, #params do
tp = type(params[i])
_G["PushScaleformMovieFunctionParameter" .. tp:sub(1,1):upper()..tp:sub(2)](params[i])
end
PopScaleformMovieFunctionVoid()
return scaleform
end
Usage example
Citizen.CreateThread(function()
params = {"<i>~p~"..'HELLO'.."</i>", 'anither text', ":)"}
scaleform = Initialize("MP_BIG_MESSAGE_FREEMODE", "SHOW_TERRITORY_CHANGE_MP_MESSAGE", params)
while true do
Citizen.Wait(0)
DrawScaleformMovie(scaleform, 0.5, 0.5, 0.8, 0.8, 255, 255, 255, 255, 0)
end
end)