By your code, are you basically trying to draw one image on the HUD if
it's specified? And otherwise draw a specified color if not?

In short, what are you doing and what is it for? Just curious.

Chris Adams wrote:

You're a legend. :-)

---------------------------------------
Chris Adams


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alfred Reynolds
Sent: 10 August 2005 21:06
To: hlcoders@list.valvesoftware.com
Subject: RE: [hlcoders] HUD element problem

Call:
surface()->DrawSetColor( Color( 255,255,255,255) ) before the
surface()->DrawTexturedRect() call (the DrawTexturedRect() currently
assumes the texture will be colored via the fill color and won't draw it
if the current draw color is fully transparent). Note that if you do
want the draw color to blend with the texture add:
        "$vertexcolor" 1
        "$vertexalpha" 1

To your vmt.


- Alfred

----Original Message----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Adams
Sent: Wednesday, August 10, 2005 12:59 PM To:
hlcoders@list.valvesoftware.com Subject: RE: [hlcoders] HUD element
problem



"UnlitGeneric"
{
"$basetexture" "hud/hud_ammo"
"$ignorez" 1
"$translucent" "1"
"$translucency" "1"
"nomip" "1"
"nocompress" "1"
"nolod" "1"
}

Thanks,

---------------------------------------
Chris Adams

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alfred
Reynolds
Sent: 10 August 2005 20:53
To: hlcoders@list.valvesoftware.com
Subject: RE: [hlcoders] HUD element problem

What are the VMT settings for the texture you are rendering?

- Alfred

----Original Message----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Adams
Sent: Wednesday, August 10, 2005 12:02 PM To:
hlcoders@list.valvesoftware.com Subject: RE: [hlcoders] HUD element
problem



BaseClass::OnThink() added, thanks for reminding, but no effect to
the bug. The hiddenbits don't seem to be causing it either. One
interesting thing - if I set in hud_image.cpp in the constructor:

        m_FillColor = Color(0, 0, 0, 0);

To:

        m_FillColor = Color(0, 0, 0, 255);

Then the element doesn't disappear when the stuck error / drawtree
/ drawfocus / scoreboard goes.

Thanks,

---------------------------------------
Chris Adams

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alfred
Reynolds Sent: 10 August 2005 19:51
To: hlcoders@list.valvesoftware.com
Subject: RE: [hlcoders] HUD element problem

You should call BaseClass::OnThink() in your think functions (in
general always chain back calls when you override a virtual
function).

Could the problem be that the element is hidden because of the
hiddenbits you set?

- Alfred

----Original Message----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Adams Sent: Wednesday, August 10, 2005 11:39 AM To:
hlcoders@list.valvesoftware.com Subject: RE: [hlcoders] HUD element
problem



Hi,

Thanks for the reply - parent call appears to be present and
correct. Here are links to the various files. I've used ImagePanel
as well as random modifications to make HudImagePanel in
hud_image.cpp - it's a bit messy at the moment as I have
SetVisible(), etc, all over the place in efforts to make things
work :-). Just looking at how it all has gone together now it just
doesn't look right but I can't really put my finger on it lol :-)

http://www.cfadams.co.uk/hud_image.cpp
http://www.cfadams.co.uk/hud_image.h
http://www.cfadams.co.uk/hud_ammo_image.cpp
http://www.cfadams.co.uk/hud_ammo_image.h

Thanks

---------------------------------------
Chris Adams

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alfred
Reynolds Sent: 10 August 2005 18:58
To: hlcoders@list.valvesoftware.com
Subject: RE: [hlcoders] HUD element problem

It sounds like your HUD element may have the wrong parent (in
VGUI2 your visibility depends on your parents visibility unless
you are a popup (a Frame) ).

Make sure your HUD elements construct has a SetParent() call,
something like this: SetParent( g_pClientMode->GetViewport() );


- Alfred

----Original Message----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Adams Sent: Wednesday, August 10, 2005 9:08 AM To:
hlcoders@list.valvesoftware.com Subject: [hlcoders] HUD element
problem



(Apologies if this appears twice)

I've made a HUD element class which essentially displays an
image and I have declared two child classes as HUD elements.
The two elements are showing fine, but for some bizarre reason
they only now show when there is one of the following active
(there are probably more but I haven't noticed yet)

        - vgui_drawtree
        - vgui_drawfocus
        - The scoreboard
        - A 'client stuck' or 'server stuck' notice in the


top-right


I have also noticed that if I press ` for the console, then
press it again to hide the console, the hud elements appear
very very briefly before disappearing again. Through the
debugging that I've done so far, I do know that they are
drawing still and SetEnabled, SetVisible and SetAlpha all are
set correctly.

Anyone have any suggestions as to what might be going on here?
I'll put the relevant source code up on the net if it would
help.

Thanks,

---------------------------------------
Chris Adams




_______________________________________________
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




_______________________________________________
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




_______________________________________________
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




_______________________________________________
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




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






--
Kamran A
Get Firefox! Safer, Faster, Better.
<http://www.spreadfirefox.com/?q=affiliates&id=0&t=85>
Down with Internet Explorer! Say "NO!" to Spyware! Use Firefox

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

Reply via email to