Re: [hlcoders] Hud positioning/scaling help

2006-07-19 Thread Steve Rabouin
--
[ Picked text/plain from multipart/alternative ]
Try using the XRES() and YRES() functions, and base your code off that, this
way you will get correct placement for any resolution, even if it is changed
while in game.

On 7/19/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> Im having trouble positioning and scaling some of the images I have for my
> hud. I know that im supposed to position them in 640x480, but when I do
> that, if I then take it up to say 1024x768 then some of the images now
> intersect with the text, because the text is now bigger.
>
> And, since in the hud I have a health bar, in 640x480 it is really big,
> and
> in higher resolutions it is just fine, how would I scale it down only if
> the
> resolution is 640x480?
>
> This is my hud:
> http://img529.imageshack.us/img529/6661/newhudpi2.jpg
>
> And I have it all worked out in the code, it is just the images are not
> scaling down or up, which is really frustrating me :(
>
> I tried doing something like:
> #define RES640 113
>
> engine->GetScreenSize(m_iScreenWidth,m_iScreenHeight);
>
> if(m_iScreenWidth == 640){
>healthBar->SetSize(m_iHealth * (RES640 / 100),8); //Update the size
> of the Health Bar
> }
>
> The size of the healthbar is not 100 pixel's across, so I have to multiply
> the current health by a certain fraction. So I take the width it should be
> (RES640) and divide it by 100, which should give me a fraction and set it
> to
> the write width, which it doesn't it is alway's to big for it, though it
> should be just right.
>
>
> Thanks to anyone that can help me :D
>
>
> -Michael Kramer
> --
>
> ___
> 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



[hlcoders] Hud positioning/scaling help

2006-07-19 Thread Michael Kramer
--
[ Picked text/plain from multipart/alternative ]
Im having trouble positioning and scaling some of the images I have for my
hud. I know that im supposed to position them in 640x480, but when I do
that, if I then take it up to say 1024x768 then some of the images now
intersect with the text, because the text is now bigger.

And, since in the hud I have a health bar, in 640x480 it is really big, and
in higher resolutions it is just fine, how would I scale it down only if the
resolution is 640x480?

This is my hud:
http://img529.imageshack.us/img529/6661/newhudpi2.jpg

And I have it all worked out in the code, it is just the images are not
scaling down or up, which is really frustrating me :(

I tried doing something like:
#define RES640 113

engine->GetScreenSize(m_iScreenWidth,m_iScreenHeight);

if(m_iScreenWidth == 640){
healthBar->SetSize(m_iHealth * (RES640 / 100),8); //Update the size
of the Health Bar
 }

The size of the healthbar is not 100 pixel's across, so I have to multiply
the current health by a certain fraction. So I take the width it should be
(RES640) and divide it by 100, which should give me a fraction and set it to
the write width, which it doesn't it is alway's to big for it, though it
should be just right.


Thanks to anyone that can help me :D


-Michael Kramer
--

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