hi everyone
I have some trouble for update my life bar, my life bar is flickering ><
In my flash file I have 11 frame for the life bar (1st frame is for full life and the 11 is for empty life)
in the action of the flash file i have this function for calculate the frame with for given life amout :
after in my GFx_ResistanceHUD.uc I done that for the update :
and this is my ResistanceHUD.uc
I have some trouble for update my life bar, my life bar is flickering ><
In my flash file I have 11 frame for the life bar (1st frame is for full life and the 11 is for empty life)
in the action of the flash file i have this function for calculate the frame with for given life amout :
Code:
function updateHealth(_health:int) { if (_health == 0) healthBar.gotoAndPlay(11); else healthBar.gotoAndPlay(11-((_health % 10)+1)); }
Code:
function UpdateHealth() { local ASValue Param0; local array<ASValue> args; Param0.Type = AS_Number; Param0.n = ResistancePawn(GetPC().Pawn).Health; args.Length = 1; args[0] = Param0; RootMC.Invoke("updateHealth", args); } function UpdateHUD(){ UpdateHealth(); }
Code:
class ResistanceHUD extends UDKHUD; var GFx_ResistanceHUD HudMovie; simulated function PostBeginPlay() { super.PostBeginPlay(); HudMovie = new class'GFx_ResistanceHUD'; HudMovie.SetTimingMode(TM_Real); HudMovie.Init(class'Engine'.static.GetEngine().GamePlayers[HudMovie.LocalPlayerOwnerIndex]); HudMovie.Start(); HudMovie.Advance(0); HudMovie.SetViewScaleMode(SM_ExactFit); } event PostRender() { HudMovie.UpdateHUD(); }
Comment