Re: [hlcoders] HUD drawing problems

2006-07-21 Thread Wraiyth
--
[ Picked text/plain from multipart/alternative ]
I don't think it can be done for a HUD element... I'll just edit
HudLayout.res from my laptop and use hud_reloadscheme, because closing and
opening HL2 gets annoying :)

On 7/22/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> Not that I know of. But if you find one let me know :)
> --
>
> ___
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--
Matt Stafford (Wraiyth)
http://wraiyth.freesuperhost.com
NightFall HL2 Mod - http://nightfall.nigredostudios.com
--

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



Re: [hlcoders] HUD drawing problems

2006-07-21 Thread Michael Kramer
--
[ Picked text/plain from multipart/alternative ]
Not that I know of. But if you find one let me know :)
--

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



Re: [hlcoders] HUD drawing problems

2006-07-21 Thread Wraiyth
--
[ Picked text/plain from multipart/alternative ]
Thanks heaps, got it all working nicely now :)
One final question, is there a way to activate build mode for the HUD?
SHIFT+ALT+CTRL+B doesn't work (all I do is crouch, prone, sprint :P)

On 7/22/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> Alright here is what I have:
>
> This is how I have the background for my Health Bar
>
> First off, my health bar has rounded edges, so I have three different
> images:
>
> vgui::ImagePanel *healthLeft;
> vgui::ImagePanel *healthBg;
> vgui::ImagePanel *healthRight;
>
> Each image is 5px X 5px (8X8 In vtf)
>
> I set it up like so:
> vgui::Panel *pParent = g_pClientMode->GetViewport();
> SetParent( pParent );
>
> healthLeft = vgui::SETUP_PANEL(new vgui::ImagePanel(parent,
> "HealthLeft"));
> healthLeft->SetImage("health_left");
> healthBg = vgui::SETUP_PANEL(new vgui::ImagePanel(parent, "HealthBg"));
> healthBg->SetImage("health_bg");
> healthRight = vgui::SETUP_PANEL(new vgui::ImagePanel(parent,
> "HealthRight"));
> healthRight->SetImage("health_right");
>
> Then Under a seperate Function ( Init() )
> I have
>
> C_BasePlayer *local = C_BasePlayer::GetLocalPlayer();
> int health = max( local->GetHealth(), 0 );
>
> healthLeft->SetSize(XRES(5),YRES(5));
> healthLeft->GetImage()->SetSize(XRES(5),YRES(5));
> healthLeft->SetPos(XRES(8),YRES(35));
> healthLeft->SetZPos(1);
>
> healthBg->SetSize(XRES((health - 5) * 2),YRES(5));
> healthBg->GetImage()->SetSize(XRES(health),YRES(5)); //Streches the bg to
> match health
> healthBg->SetPos(XRES(13),YRES(35));
> healthBg->SetZPos(1);
>
> healthRight->SetSize(XRES(5),YRES(5));
> healthRight->GetImage()->SetSize(XRES(5),YRES(5));
> healthRight->SetPos(healthBg->GetWide()+ XRES(10),YRES(35)); //Places the
> right image after the bg.
> healthRight->SetZPos(2);
>
> I call the Init() Function in Paint( void ), I do this so that if the
> player
> changes the Resolution in game, everything will get aligned and scaled
> properly.
>
>
>
> Remember that you need to position and scale everything in 640x480, and
> using the XRES and YRES functions it will scale accurately for the other
> resolutions.
>
> Hopefully this will help.
> --
>
> ___
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--
Matt Stafford (Wraiyth)
http://wraiyth.freesuperhost.com
NightFall HL2 Mod - http://nightfall.nigredostudios.com
--

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



Re: [hlcoders] HUD drawing problems

2006-07-21 Thread Michael Kramer
--
[ Picked text/plain from multipart/alternative ]
Alright here is what I have:

This is how I have the background for my Health Bar

First off, my health bar has rounded edges, so I have three different
images:

vgui::ImagePanel *healthLeft;
vgui::ImagePanel *healthBg;
vgui::ImagePanel *healthRight;

Each image is 5px X 5px (8X8 In vtf)

I set it up like so:
vgui::Panel *pParent = g_pClientMode->GetViewport();
SetParent( pParent );

healthLeft = vgui::SETUP_PANEL(new vgui::ImagePanel(parent, "HealthLeft"));
healthLeft->SetImage("health_left");
healthBg = vgui::SETUP_PANEL(new vgui::ImagePanel(parent, "HealthBg"));
healthBg->SetImage("health_bg");
healthRight = vgui::SETUP_PANEL(new vgui::ImagePanel(parent,
"HealthRight"));
healthRight->SetImage("health_right");

Then Under a seperate Function ( Init() )
I have

C_BasePlayer *local = C_BasePlayer::GetLocalPlayer();
int health = max( local->GetHealth(), 0 );

healthLeft->SetSize(XRES(5),YRES(5));
healthLeft->GetImage()->SetSize(XRES(5),YRES(5));
healthLeft->SetPos(XRES(8),YRES(35));
healthLeft->SetZPos(1);

healthBg->SetSize(XRES((health - 5) * 2),YRES(5));
healthBg->GetImage()->SetSize(XRES(health),YRES(5)); //Streches the bg to
match health
healthBg->SetPos(XRES(13),YRES(35));
healthBg->SetZPos(1);

healthRight->SetSize(XRES(5),YRES(5));
healthRight->GetImage()->SetSize(XRES(5),YRES(5));
healthRight->SetPos(healthBg->GetWide()+ XRES(10),YRES(35)); //Places the
right image after the bg.
healthRight->SetZPos(2);

I call the Init() Function in Paint( void ), I do this so that if the player
changes the Resolution in game, everything will get aligned and scaled
properly.



Remember that you need to position and scale everything in 640x480, and
using the XRES and YRES functions it will scale accurately for the other
resolutions.

Hopefully this will help.
--

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



Re: [hlcoders] HUD drawing problems

2006-07-21 Thread Wraiyth
--
[ Picked text/plain from multipart/alternative ]
My images seem to be drawing excessively small when I do that. I'm still
playing around with it, but did you have it as a separate entry in
HudLayout.res or just that code tacked on to hud_health (or any other
Hud element)?


On 7/21/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> The way I have been drawing my images on the hud is with:
>
>vgui::ImagePanel *hudBg;
>
>hudBg = vgui::SETUP_PANEL(new vgui::ImagePanel(this, "HealthBg"));
>hudBg->SetImage("hud_health_bg");
>hudBg->SetSize(this->GetWide(),this->GetTall());
>hudBg->GetImage()->SetSize(this->GetWide() , this->GetTall());
>hudBg->SetPos(52,22);
>hudBg->SetZPos(1);
>hudBg->SetVisible(true);
>
>
> I don't know if that is the proper way to do it, but it works fine for me.
> --
>
> ___
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--
Matt Stafford (Wraiyth)
http://wraiyth.freesuperhost.com
NightFall HL2 Mod - http://nightfall.nigredostudios.com
--

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



Re: [hlcoders] HUD drawing problems

2006-07-20 Thread Michael Kramer
--
[ Picked text/plain from multipart/alternative ]
The way I have been drawing my images on the hud is with:

   vgui::ImagePanel *hudBg;

   hudBg = vgui::SETUP_PANEL(new vgui::ImagePanel(this, "HealthBg"));
   hudBg->SetImage("hud_health_bg");
   hudBg->SetSize(this->GetWide(),this->GetTall());
   hudBg->GetImage()->SetSize(this->GetWide() , this->GetTall());
   hudBg->SetPos(52,22);
   hudBg->SetZPos(1);
   hudBg->SetVisible(true);


I don't know if that is the proper way to do it, but it works fine for me.
--

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



[hlcoders] HUD drawing problems

2006-07-20 Thread Wraiyth
--
[ Picked text/plain from multipart/alternative ]
Hey all,
I've been puzzling over this for about a week now. I want to draw a
background image for the health for the HUD I'm working on. I can get the
image drawing alright using
vgui::surface()->DrawTexturedRect( 0, 0, this->GetWide(), this->GetTall() );
However, as soon as I obtain a weapon, the image disappears. When I drop the
weapon, it reappears.
I've got SetHiddenBits to HIDEHUD_PLAYERDEAD | HIDEHUD_NEEDSUIT, which is
what everything else is set to (and everything else works).
Any ideas on whats going wrong, or alternately, a better way to draw an
image to sit right behind the health & scale for different res's?

Matt
--

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