-
-
Save qoh/5160868 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tacticalHUD::updateControls( %this, %width, %height ) | |
{ | |
%this.healthMeter.updateControls( %width, %height ); | |
} | |
function tacticalHUD_healthMeter::updateControls( %this, %width, %height ) | |
{ | |
%x = tacticalHUD.x + ( ( %width / 2 ) - 170 ) | |
%y = tacticalHUD.y + 182; | |
%this.position = %x SPC %y; | |
%this.extent = "400 8"; | |
%this.bar.updateControls( %width, %height ); | |
} | |
function tacticalHUD_healthMeter_bar::updateControls( %this, %width, %height ) | |
{ | |
%health = 75; | |
%factor = mClampF( %health / 100, 0, 1 ); | |
%color = colorGradient( %factor, $THUD::Color[ "panic" ], $THUD::Color[ "default" ] ); | |
%color = vectorScale( %color, 0.00625 ); | |
%this.extent = 400 * %factor SPC 8; | |
%this.setColor( %color SPC 160 / 255 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment