PDA

View Full Version : scaleOverTime problem



RobsoN
27th October 2013, 10:12
Hello I just wanted to make fuel qauge for my rocket, using progressbar and scaleOverTime. I wanted to move it by vertical (from top to bottom). This is my code which doesn't work correctly:



player.hud_progressbackground = newClientHudElem(player);
player.hud_progressbackground.x = 420;
player.hud_progressbackground.y = 350;
player.hud_progressbackground.alignX = "left";
player.hud_progressbackground.alignY = "bottom";
player.hud_progressbackground.horzAlign = "fullscreen";
player.hud_progressbackground.vertAlign = "fullscreen";
player.hud_progressbackground.alpha = 0.5;
player.hud_progressbackground.sort = 1;
player.hud_progressbackground setShader("gfx/hud/hud@health_bar.tga", 12 , 196);

player.hud_progressbar = newClientHudElem(player);
player.hud_progressbar.x = 422;
player.hud_progressbar.y = 348;
player.hud_progressbar.alignX = "left";
player.hud_progressbar.alignY = "bottom";
player.hud_progressbar.horzAlign = "fullscreen";
player.hud_progressbar.vertAlign = "fullscreen";
player.hud_progressbar setShader("gfx/hud/hud@health_bar.tga", 8, 190);
player.hud_progressbar.color = (0,255,0);
player.hud_progressbar.alpha = 0.5;
player.hud_progressbar.sort = 2;

player.hud_progressbar scaleOverTime(15, 8, 0);



Any tips please? :)

kung foo man
27th October 2013, 10:36
"doesn't work correctly" is not a good info :D

RobsoN
27th October 2013, 10:40
I didn't know how to explain. I'll show it on image (paint master)

serthy
27th October 2013, 11:21
was trying to do the same months ago and have had similar issues with hud + relative alignment + scaling, seems to be a cod2 bug. couldnt find statisfiing solutions for it.

Ni3ls
27th October 2013, 12:25
Maybe u can fake the scaleovertime by adding manually the green progress

Tally
27th October 2013, 15:32
was trying to do the same months ago and have had similar issues with hud + relative alignment + scaling, seems to be a cod2 bug. couldnt find statisfiing solutions for it.

Look at the sprint hud in COD2 eXtreme+ mod. They have a vertical scaleover that works flawlessly. If they can do, so can anyone else.

RobsoN
27th October 2013, 17:32
I made loop with y -= 1.3 per .1 second, and everything is good. Thanks for help.