Hello,
I created a heads up display for someone, and here is a picture of it:
[IMG]http://i58.tinypic.com/zslump.jpg[/IMG]
I used stencils to achieve this effect. However, the downside to the heads up display is that when I pick up a prop with the physics gun, the menu turns into the following picture:
[IMG]http://i60.tinypic.com/2edbbs3.png[/IMG]
It seems the physics gun uses the halo.Add effect to accomplish the outline around props. I don't know why it breaks my heads up display. Can someone please help me out? Here is my sample code:
[CODE]
render.ClearStencil( );
render.SetStencilEnable( true );
render.SetStencilCompareFunction( STENCIL_ALWAYS );
render.SetStencilFailOperation( STENCIL_ZERO );
render.SetStencilPassOperation( STENCIL_ZERO );
render.SetStencilZFailOperation( STENCIL_ZERO );
surface.SetDrawColor( Color( 0, 0, 0, 255 ) );
surface.SetMaterial( white );
surface.DrawPoly( p1 );
render.SetStencilCompareFunction( STENCIL_EQUAL );
render.SetStencilPassOperation( STENCIL_INCR );
render.SetStencilReferenceValue( 1 );
surface.SetDrawColor( Color( 255, 255, 255, 255 ) );
surface.SetMaterial( car_diag );
surface.DrawTexturedRect( 0, ScrH( ) - bh, 1024, 1024 );
render.SetStencilEnable( false );[/CODE]
Sorry, you need to Log In to post a reply to this thread.