Shaders work too with fadeovertime
PHP Code:{
hud = newClientHudElem(self);
hud.horzAlign = "fullscreen";
hud.vertAlign = "fullscreen";
hud setShader("white", 640, 480);
hud.alpha = 1;
hud.x = 0;
hud.y = 0;
hud fadeovertime(2.5);
hud.alpha = 0;
}
Printable View
Shaders work too with fadeovertime
PHP Code:{
hud = newClientHudElem(self);
hud.horzAlign = "fullscreen";
hud.vertAlign = "fullscreen";
hud setShader("white", 640, 480);
hud.alpha = 1;
hud.x = 0;
hud.y = 0;
hud fadeovertime(2.5);
hud.alpha = 0;
}
Doesn't work, you tested it with your own texture?
If yes and if it does work, then do a .iwd file and upload here, I want to check it.
Edit: My current HUD script:
notes:PHP Code:spawnHud()
{
hud = newClientHudElem(self);
hud.horzAlign = "fullscreen";
hud.vertAlign = "fullscreen";
hud setShader("texture_test", 640, 480);
hud.alpha = 1;
hud.x = 0;
hud.y = 0;
hud fadeovertime(10);
hud.alpha = 0;
self thread destroyOnDeath(hud);
}
destroyOnDeath(hud)
{
self waittill("killed_player");
if(isDefined(hud))
hud destroy();
}
- spawnHud() will be called if someone is spawning
- destroyOnDeath() will be called if someone die
- the shader "texture_test" is precached
- the hud spawns instantly (visible) and not from visible to invisible
In game it looks like this (after spawned):
Attachment 676
The thing I posted works. I use it for flashnade. The shader "white" is a default cod2 shader. I didnt test it with own texture. Maybe you need to compile your shader with certain options to make it work
fadeOverTime() works on shaders as well.
Example of a working fading server logo shader:
PHP Code:if( isdefined( level.svrlogo ) ) level.svrlogo destroy();
if( !isdefined( level.svrlogo ) )
{
level.svrlogo = newHudElem();
level.svrlogo.x = X;
level.svrlogo.y = Y;
level.svrlogo.hidden = false;
level.svrlogo.alignX = "left";
level.svrlogo.alignY = "top";
level.svrlogo.horzAlign = "fullscreen";
level.svrlogo.vertAlign = "fullscreen";
level.svrlogo.archived = false;
level.svrlogo.hideWhenInMenu = true;
level.svrlogo setShader( game[ "demonlogo" ], W, D );
level.svrlogo.alpha = 0;
}
for( ;; )
{
wait looptime;
if( isdefined( level.svrlogo ) ) level.svrlogo fadeOverTime( 2 );
if( isdefined( level.svrlogo) ) level.svrlogo.alpha = .7;
wait screentime;
if( isdefined( level.svrlogo ) ) level.svrlogo fadeOverTime( 2 );
if( isdefined( level.svrlogo ) ) level.svrlogo.alpha = 0;
}
No, now I found the problem, I looked on the material and image from the shader "black" and "white".
The material name is "black" and the image name is "$black" (open the material from main/iw_13.iwd/materials/black to see what image name it has).
You can also read the options what there is used for the material, but I it's just hard to understand, what they set:
Code:V \ e‘( P D P c \ tools black $black colorMap