Re: [hlcoders] Full-screen HudElement

2006-07-13 Thread John Sheu
On Wednesday 12 July 2006 2:13 pm, Garry Newman wrote:
 I use OnScreenSizeChanged

 ISurface.h

 // video mode changing
 virtual void OnScreenSizeChanged( int nOldWidth, int nOldHeight ) = 0;

 Does the job I think.

That gave me a pretty good idea, which I'm using right now.  Hook
OnScreenSizeChanged on CBaseViewport, and just gHUD.Shutdown() then
gHUD.Init().

Works well enough.

-John Sheu

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



[hlcoders] Full-screen HudElement

2006-07-12 Thread John Sheu
So what's the best way to make a HudElement full-screen?  I've tried out a few
approaches, but I'm not sure which one could be considered correct in the
spirit of VGUI implementation.  Note: just setting it 640x480 in
HudLayout.res won't work for us widescreeners.



Hooking into VidInit(), with SetBounds( 0, 0, ScreenWidth(), ScreenHeight() ).
(Or should that be Init() ?)  Hopefully this is called every time the video
mode changes, so things resize appropriately should the player decide to
change video sizes.

Setting xpos to something ridiculous like 800 in HudLayout.res.  This then
introduces issues with placement of sub-panels.

The solution I'm using now: overriding ApplySettings() and setting the bounds
to maximum after the baseclass ApplySettings() is called.  In my experience,
this is called after video mode changes as well, so it holds well.



So which one?

-John Sheu

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



Re: [hlcoders] Full-screen HudElement

2006-07-12 Thread Garry Newman

I use OnScreenSizeChanged

ISurface.h

// video mode changing
virtual void OnScreenSizeChanged( int nOldWidth, int nOldHeight ) = 0;

Does the job I think.

On 7/12/06, John Sheu [EMAIL PROTECTED] wrote:

So what's the best way to make a HudElement full-screen?  I've tried out a few
approaches, but I'm not sure which one could be considered correct in the
spirit of VGUI implementation.  Note: just setting it 640x480 in
HudLayout.res won't work for us widescreeners.



Hooking into VidInit(), with SetBounds( 0, 0, ScreenWidth(), ScreenHeight() ).
(Or should that be Init() ?)  Hopefully this is called every time the video
mode changes, so things resize appropriately should the player decide to
change video sizes.

Setting xpos to something ridiculous like 800 in HudLayout.res.  This then
introduces issues with placement of sub-panels.

The solution I'm using now: overriding ApplySettings() and setting the bounds
to maximum after the baseclass ApplySettings() is called.  In my experience,
this is called after video mode changes as well, so it holds well.



So which one?

-John Sheu

___
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