Post: [RELEASE] Progress Bar Manipulation
09-01-2011, 05:28 AM #1
Blackstorm
Veni. Vidi. Vici.
(adsbygoogle = window.adsbygoogle || []).push({}); I really wouldn't consider this a release, only one special function I made for it is new.

So here is your createBar function which is in _hud_util.gsc

    
createBar( color, width, height );


What color does is set the color of your progress bar fill, then width and height is pretty much self-explanatory.

I use these for width and height;

width: level.primaryProgressBarWidth + number to increase by
height: level.primaryProgressBarHeight

Then, to make it move, you can use this function I created:

    
setBarScale( barFrac, scaleTime )
{
barWidth = ceil(self.width * barFrac);
if ( !barWidth ) barWidth = 1;
self.bar.frac = barFrac;
barWidth *= (barWidth > 0) * (barWidth <= self.width);
self.bar scaleOverTime( scaleTime, barWidth, self.height );
wait scaleTime;
}


barFrac must be a percentage of 100. scaleTime is the time you want the bar to move, in seconds.

An example of this would be:

    
doThis()
{
percent = 25/100;
progress = self createBar( (1,0,0), level.primaryProgressBarWidth + 50, level.primaryProgressBarHeight + 5 );
progress setPoint( "CENTER" );
progress setBarScale( percent, .6 );
}


The bar would move up 25% in 0.6 seconds.

Enjoy, I hope this comes to use. =D

This is compatible in ALL CoD's.

Also, this is pretty stable. WAY more stable than the _hud_util function updateBar().

WAAAAY more stable. Anyways, again, enjoy. =D
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to Blackstorm for this useful post:

aerosoul94, Baby-panama, Correy
09-01-2011, 11:40 AM #2
i used this in my waw menu along time ago Happy its so much better
09-02-2011, 12:37 AM #3
Blackstorm
Veni. Vidi. Vici.
Originally posted by IELIITEMODZX View Post
i used this in my waw menu along time ago Happy its so much better


Yep, this is pretty old... :p
09-10-2011, 02:51 AM #4
Default Avatar
Cade
Guest
Originally posted by Blackstorm View Post
I really wouldn't consider this a release, only one special function I made for it is new.

So here is your createBar function which is in _hud_util.gsc

    
createBar( color, width, height );


What color does is set the color of your progress bar fill, then width and height is pretty much self-explanatory.

I use these for width and height;

width: level.primaryProgressBarWidth + number to increase by
height: level.primaryProgressBarHeight

Then, to make it move, you can use this function I created:

    
setBarScale( barFrac, scaleTime )
{
barWidth = ceil(self.width * barFrac);
if ( !barWidth ) barWidth = 1;
self.bar.frac = barFrac;
barWidth *= (barWidth > 0) * (barWidth <= self.width);
self.bar scaleOverTime( scaleTime, barWidth, self.height );
wait scaleTime;
}


barFrac must be a percentage of 100. scaleTime is the time you want the bar to move, in seconds.

An example of this would be:

    
doThis()
{
percent = 25/100;
progress = self createBar( (1,0,0), level.primaryProgressBarWidth + 50, level.primaryProgressBarHeight + 5 );
progress setPoint( "CENTER" );
progress setBarScale( percent, .6 );
}


The bar would move up 25% in 0.6 seconds.

Enjoy, I hope this comes to use. =D

This is compatible in ALL CoD's.

Also, this is pretty stable. WAY more stable than the _hud_util function updateBar().

WAAAAY more stable. Anyways, again, enjoy. =D


Gee, I wonder what you used this in :carling:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo