It's not safe to try to draw anything to the HUD outside the HUD Draw code.


 If you try to call it from someplace else, the screen might not be set in
the proper way to render them. DrawPlayer is further down the pipeline and
is not set to draw in ortho projection mode. Hence it will rendered in a 3D
space rather than the tipical HUD mode ( plus it will get z clipped if it's
behind anything ). You should store the names and position you want and
render them later ( one frame late ) from a HUD element's draw function.

 Hope this works.

-----Original Message-----
From: Nate Lovallo
To: [EMAIL PROTECTED]
Sent: 5/4/2002 6:14 PM
Subject: [hlcoders] Wierdest thing ever....

This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
OK, so I got my names to work. But now when i try to hud rendering code
from the studiomodelrender heres what happened.

http://home.attbi.com/~inbeastic/images/airplane20000.jpg

>From what i can see, the hud is being rendered in space?
heres my code in DrawPlayer

 if (cl_drawpnames->value > 0)
 {
  vec3_t screen;
  int nx, ny, orgx, orgy;

  gEngfuncs.pTriAPI->WorldToScreen(m_pCurrentEntity->origin,screen);

  screen[0] = XPROJECT(screen[0]);
  screen[1] = YPROJECT(screen[1]);
  screen[2] = 0.0f;


  nx = static_cast<int>(screen[1]);

  ny = static_cast<int>(screen[0]);

  gHUD.DrawHudString(nx, ny, ScreenWidth, m_pPlayerInfo->name , 0, 128,
255);

}
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to