Announcement

Collapse
No announcement yet.

HUD trouble with update, flickering on update

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HUD trouble with update, flickering on update

    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 :
    Code:
    function updateHealth(_health:int) {
    		if (_health == 0)
    			healthBar.gotoAndPlay(11);
    		else
    			healthBar.gotoAndPlay(11-((_health % 10)+1));
    }
    after in my GFx_ResistanceHUD.uc I done that for the update :
    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();
    }
    and this is my ResistanceHUD.uc
    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();
    }

    #2
    It's flickering because it is playing a movie clip. Put stop(); on all the 11 frames of your health movie clip and then use gotoandstop in unrealscript.

    Comment


      #3
      I already have stop on all frame

      but by using gotoandstop instead of gotoandplay, work fine
      thx for your answer

      Comment

      Working...
      X