• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Overlays
#1
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
  Reply
#2
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...
  Reply
#3
(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
  Reply
#4
I wish you were modding bo.
  Reply
#5
(07-27-2011, 16:24)Lemon Wrote: I wish you were modding bo.

NO!! Let him stay in MW2!!!Big Grin
  Reply
#6
(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
  Reply
#7
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)
  Reply
#8
(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" );
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)