[Release] Lua Scaleform Wrapper

Hello, I’m releasing a Scaleform wrapper that is much easier to read and understand. Here is an example of a brief scaleform script using this wrapper.

Citizen.CreateThread(function()
	scaleform = GetScaleform("binoculars")
	i = 0
	while true do
		Wait(0)
		i = i + 1
		RenderFullscreen(scaleform)
		if i == 2000 then -- turns off after 20ish seconds
			UnloadScaleform(scaleform)
		end
	end
end)

Here’s another snippet of a helicopter hud with changing params.

Citizen.CreateThread(function()
	scaleform = GetScaleform("heli_cam")
	i = 0
	while true do
		Wait(0)
		i = i + 1
		RenderFullscreen(scaleform)
		
		if i > 500 then -- Just random example of changing the thingy.
			x = math.random(10,100)
			CallFunction(scaleform, "SET_ALT_FOV_HEADING", 152.0 + x, 0.7, 90.0 + x)			
		end
		
		if i == 3500 then -- turns off after 30ish seconds
			UnloadScaleform(scaleform)
		end
	end
end)

Here’s the download: scale.zip (1.7 KB)

The example script will create the binoculars effect for roughly 20 seconds (depending on framerate) and then it will turn the effect off by unloading the scaleform. The second example creates a helicopter hud and applies random values to it.

Credits / References used:

I hope you enjoy.

8 Likes

Great Release :clap:

1 Like

Thanks~ Just uploaded a minor fix. My validation checks were not finished haha! Not sure how I missed that :slight_smile:

Redownload and test away!

1 Like

Great!
Do you got a list of scalform availible in any chance? :slight_smile:

If you check out the Native’s DB listing I linked to (in the references section) there’s a pastebin link in there that someone was kind enough to upload.

Edit: pastebin.com/mmNdjX2k

That’s someone elses’ link, not mine :stuck_out_tongue: Through testing so far not all work.

1 Like

Any chance you make that binocular a real script with zoom/unzoom and why not even the binocular animation ?

No. I don’t have time for that. There’s no reason why you can’t do it yourself.

If anyone had this downloaded I suggest you redownload this latest version. It is now working properly. I wasn’t doing float checking properly and it should be working fine now. There’s an updated example that shows me messing with the helicopter_hud.

Thanks to @phosphorus for helping fix that.

hi… trying to use your wrapper i have errors in string… i pass a string and i get errors about numeric values

sperimenting with this

			local scegli = GetScaleform("MP_NEXT_JOB_SELECTION")
			CallFunction(scegli, "INITIALISE", 100)
			CallFunction(scegli, "SET_TITLE", "Scegli il tuo personaggio", "cosa scegli?")
			RenderFullscreen(scegli)