ItsMods

Full Version: Overlays
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Another tutorial, Nyan Cat

This is about overlays(HUD)

Paste this anywhere in your mod code:

Code:
CreateOverlay( shader_name, start_alpha, color )
{
    overlay = newHudElem();
    overlay.x = 0;
    overlay.y = 0;
    overlay setshader( shader_name, 640, 480 );
    overlay.alignX = "left";
    overlay.alignY = "top";
    overlay.sort = 1;
    overlay.color = color;
    overlay.horzAlign = "fullscreen";
    overlay.vertAlign = "fullscreen";
    overlay.alpha = start_alpha;
    overlay.foreground = true;
    return overlay;
}

Now, to call a overlay, do this:

Code:
    CreateOverlay( "shader,remember to precache it", alpha(put 1, for a good result) , (red,green,blue));

Example of use:

Code:
Mod() // A random thread name
{
    CreateOverlay( "minimap_scanlines", 1 , (0,1,0.2));
}

I hope this helps, Cool
LOL there are soo much tutorials that my head is going to explode! VERY GOOD WORK KEEP the tutorials coming, you are fantastic man!

Thanks Barata...
(07-27-2011, 14:12)barata Wrote: [ -> ]LOL there are soo much tutorials that my head is going to explode! VERY GOOD WORK KEEP the tutorials coming, you are fantastic man!

Thanks Barata...

You will all die with tuts¡¡¡¡¡¡ Tongue
I wish you were modding bo.
(07-27-2011, 16:24)Lemon Wrote: [ -> ]I wish you were modding bo.

NO!! Let him stay in MW2!!!Big Grin
(07-27-2011, 16:24)Lemon Wrote: [ -> ]I wish you were modding bo.

I and many of mw2 modders want him stay in mw2 modding.

He's one of a few great modders who keep modding mw2.

Big Grin
1 question... how can i clear the hud in order to make my own elem? (not recreating textures - just clear the hud showing only the gun and the environment)
(07-22-2012, 01:01)Twizzy Wrote: [ -> ]1 question... how can i clear the hud in order to make my own elem? (not recreating textures - just clear the hud showing only the gun and the environment)

HC mode, and set the max health back to 100...

You can also use:

Code:
self setClientDvar( "cg_draw2D", "0" );