How to use scaleforms!

@Demonen

-- local scaleform_handle = ...
-- local vehicle = ...

local camRot = GetGameplayCamRot()
local pos = GetEntityCoords(vehicle)
local min, max = GetModelDimensions(GetEntityModel(vehicle), {}, {}) 

-- Draw scaleform above vehicle and facing the player
DrawScaleformMovie_3dNonAdditive(
	scaleform_handle, --scaleform
	pos.x, pos.y, 2.25 + pos.z + max.z, --position
	0, 0, -camRot.z, -- rotation
	2.0, -- unk
	1.0, --sharpness
	1.0, -- unk,
	10.0, 4.5, 0, -- draw scale
	0 -- unk
)

Also just dumping this here for whoever finds it useful, coords for michaels living room projector…

-- Breaking news scaleform on projector
local s_news = LoadScaleForm('breaking_news')
PushScaleformMovieFunction(s_news, "SHOW_STATIC")
PushScaleformMovieFunctionParameterInt(1)
PopScaleformMovieFunctionVoid()
DrawScaleformMovie_3dNonAdditive(
 	s_news, --scaleform
 	-800.158, 173.603, 74.38,
 	0.0, 0.0, 69.13,
 	1.0, 1.0, 1.0,
 	3.163, 1.783, 1.0,
 	2
)

For those interested in making their own scaleforms; You can grab COH2 tools through steam :sweat_smile:

2 Likes

COH2?

Absolutely great, thanks.
Is this stuff per frame, or what?

@Demonen DrawScaleformMovie_3dNonAdditive should be called every frame, yes.

Anyone know the scaleform for the “Takedown” bar in lspdfr?

NativeUI uses this (not a scaleform):

Sprite.Draw("timerbars", "all_black_bg", (int)res.Width - safe.X - 298, (int)res.Height - safe.Y - (40 + (4 * interval)), 300, 37, 0f, Color.FromArgb(180, 255, 255, 255));

Which uses sprites found in

GTA V/update/update.rpf/x64/textures/script_txds.rpf/timerbars.ytd/

Source

1 Like

Ahh ok. Thanks a lot.

Is it possible to draw multiples of the same scaleform at the same time? RequestScaleForm seems to return the same handle every time.

I’m not sure it’s possible. You’ll notice scaleforms such as mp_car_stats which have multiple copies. I’d tried before to just set the scaleform options multiple times per frame but that only works with a wait(0) which causes flickering.

As a work around; You can copy the gfx file and stream it.

1 Like

so ill just be “stupid” here well cause i am , but :
with the breaking news scaleform , how the eff do i actually get the top ticker to work with different kinds of messages? you know , so it actually “ticks” between them xD

also didnt the middle one scroll aswell or do i just remember that wrong ? xD

Here is a good example of the Vehicle Attributes you referenced: https://github.com/qiangqiang101/PremiumDeluxeMotorsport.NET

Cheers.