Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Moving huds :D

  1. #1
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts

    Moving huds :D

    How to make moving huds? to they are moving on screen?

    Thanks.!

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    use moveovertime, scaleovertime and fadeovertime

  3. #3
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    Code:
    something()
    { 
           self endon("disconnect"); 
    
           if(isdefined(self.m)) 
              self.m destroy(); 
    
           self.m = newClientHudElem(self); 
           self.m.x = 550; 
           self.m.y = 90; 
           self.m.alignX = "left"; 
           self.m.alpha = 0; 
           self.m.sort = 50; 
           self.m.fontScale = 1; 
           self.m.archived = true; 
    
           for(;;) 
           { 
              self.m fadeOverTime(1); 
              self.m moveOverTime(5); 
              self.m.alpha = 1; 
              self.m.label = &"something:";
    	  self.m setValue(self.something); 
              wait 300; 
              self.m fadeOverTime(1); 
              self.m.alpha = 0; 
              wait 10; 
           } 
    }
    that? its not updating huds..

  4. #4
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    you set the coordinates of the hud. Then you do moveovertime(time) and then the new coordinates of the hud

  5. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Learning by example ftw:

    PHP Code:
        self.m moveOverTime(1);
        
    self.m.550
        
    self.m.90
        
    wait 1;

        
    self.m moveOverTime(1);
        
    self.m.10
        
    self.m.10
        
    wait 1;

        
    self.m moveOverTime(1);
        
    self.m.222
        
    self.m.222
        
    wait 1;

        
    self.m moveOverTime(1);
        
    self.m.320
        
    self.m.240
        
    wait 1
    timescale 0.01

  6. #6
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    i think its what i want too but i do not knew how create
    i would like a text who is from left and who rotate for the right
    i have the HTML to create on website:

    <marquee direction="left" behavior="scroll" scrollamount="3" scrolldelay="2" style="color:#000000;font-size:32px;font-family:Arial;">my website<br>
    <br></marquee>

  7. #7
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    Quote Originally Posted by ORDI View Post
    i think its what i want too but i do not knew how create
    i would like a text who is from left and who rotate for the right
    i have the HTML to create on website:

    <marquee direction="left" behavior="scroll" scrollamount="3" scrolldelay="2" style="color:#000000;font-size:32px;font-family:Arial;">my website<br>
    <br></marquee>
    That makes no sense, he is talking about CoD2 lol

  8. #8
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by ORDI View Post
    i think its what i want too but i do not knew how create
    i would like a text who is from left and who rotate for the right
    i have the HTML to create on website:

    <marquee direction="left" behavior="scroll" scrollamount="3" scrolldelay="2" style="color:#000000;font-size:32px;font-family:Arial;">my website<br>
    <br></marquee>
    COD2 does not use HTML as a language. Please go to a web building site for your web support.

    thank you.

  9. #9
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    He is just refering to the html-element marquee as an analogy for a hud moving from right to left.

    As base you could use this old ad hud script: http://killtube.org/downloads/cod2/e...ain/std/ad.gsc

    PHP Code:
        std\ad::addAd(&"1st marquee"2, (1,0,0));
        
    std\ad::addAd(&"2nd marquee"2, (0,1,0));
        
    std\ad::addAd(&"3rd marquee"2, (0,0,1));
        
    std\ad::precache();


        
    // in startgametype:
        
    thread std\ad::ad(); 
    You basically just need to edit the for loop in ad::ad() to move it with moveOverTime() like shown in the example.

    PHP Code:
        while (1)
        {
            for (
    i=0i<level.ad.sizei++)
            {
                
    level.hud_ad.fontscale level.ad[i].scale;
                
    level.hud_ad.color level.ad[i].color;
                
    level.hud_ad fadeOverTime(1);
                
    level.hud_ad.alpha 1;
                
    level.hud_ad.label level.ad[i].ad;
                
    wait 10;
                
    level.hud_ad fadeOverTime(1);
                
    level.hud_ad.alpha 0;
                
    wait 20;
            }
        } 
    timescale 0.01

  10. The Following 2 Users Say Thank You to kung foo man For This Useful Post:

    ORDI (25th March 2014),pollo (24th March 2014)

  11. #10
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Is there any way to do a shader from .alpha 0 to .alpha 1 in 5 secounds? I tried it and there is a problem, it just showed the shader instantly. If you try it on the default shader "black", then you will see, that it works. But not on own shaders. I tried already fadeOverTime(time) too, but it doesn't work, only on text.

Posting Permissions

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