Source SDK

Source SDK

Animating VGUI panel movement?
Is there any way to animate VGUI panels or Image resources? I'd like to have some images and panels that scale, move, and fade...
< >
Zobrazeno 14 z 4 komentářů
Pep 14. čvc. 2014 v 21.06 
You can access the scale and position of any VGUI element programatically by accessing its position and scale member things, can't you? Could you create some kind of iterative functions to slowly increment or decrease these values to your specifications using tick events or something? You could write something that uses cfgs or txt scripts with parameters that it reads per line as instructions, taking the desired scale and rotation of a named element and iterating by a given number of pixels until the desired position or scale is achieved? Or does this sound too expensive?
Tick-based animation sounds expensive, but maybe that's the best way to do it... I wonder if anyone has extended the HUD animation stuff to regular VGUI items.
Tick based animations aren't expensive at all really, you can even adjust their interval. And remove the ticks as you please.

Use GetAnimationController()->RunAnimationCommand to perform animations on either size, position, alpha, etc... You can run this command on any vgui control or on the actual panel to affect everything.

Notice that size and pos needs two values so you'll have to pass in the two values as an array but it only implements the array Color.

Color myPos( 200, 200, 0, 0 ) B and A is not used, only R and G.
Naposledy upravil BerntA; 16. čvc. 2014 v 15.29
oh neato.. gona try that ;)
< >
Zobrazeno 14 z 4 komentářů
Na stránku: 1530 50

Datum zveřejnění: 14. čvc. 2014 v 20.06
Počet příspěvků: 4