How to make moving huds? to they are moving on screen?
Thanks.!
Printable View
How to make moving huds? to they are moving on screen?
Thanks.!
use moveovertime, scaleovertime and fadeovertime
that? its not updating huds..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;
}
}
you set the coordinates of the hud. Then you do moveovertime(time) and then the new coordinates of the hud
Learning by example ftw:
PHP Code:
self.m moveOverTime(1);
self.m.x = 550;
self.m.y = 90;
wait 1;
self.m moveOverTime(1);
self.m.x = 10;
self.m.y = 10;
wait 1;
self.m moveOverTime(1);
self.m.x = 222;
self.m.y = 222;
wait 1;
self.m moveOverTime(1);
self.m.x = 320;
self.m.y = 240;
wait 1;
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>
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
You basically just need to edit the for loop in ad::ad() to move it with moveOverTime() like shown in the example.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();
PHP Code:
while (1)
{
for (i=0; i<level.ad.size; i++)
{
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;
}
}
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.