Results 1 to 10 of 20

Thread: [Tutorial][Work in progress] Hud elements

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    Hey

    I had some trouble while setting the alpha value of some huds by using the "fadeovertime()" function (sometimes when 2 funcs change the alpha value of a same hud, it kinda "flashes", or become transparent/opaque in a short time), so I made this little one which seems to work fine.

    PHP Code:
    //call the function like this:

    //thread _alphahud(level.hud,true);

    //hud = your hud
    //show = boolean (true, hud fades to opaque; false, it fades to transparent)
    //you can also add a time variable in the function to edit it at your own

    _alphahud(hud,show)
    {
    self endon("disconnect");
        for(
    i=0;i<20;i++)
        {
            if(
    show == true)
            {
            
    hud.alpha += 0.05;
                if(
    hud.alpha == 1)
                    break;
            }
            else
            {
            
    hud.alpha -= 0.05;
                if(
    hud.alpha == 0)
                    break;
            }
        
    wait .05;
        }
    return;

    Last edited by pollo; 22nd September 2014 at 20:56.

  2. The Following User Says Thank You to pollo For This Useful Post:

    guiismiti (22nd September 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •