some simple questions

Posted By: onslaught147

some simple questions - 09/10/07 01:47

i am making a fps and i am using a panel for the health bar. the thing is i originally planned to have the pos_x of the panel to be the health variable and have the ability to give the panel a -x value which would move it off screen and give the impression that the bar was getting smaller but when i try this the game brings up a error. it seems i cant use a variable to define the pos_x of a panel, so does anyone know a way around this or a different way to get a health bar?
Posted By: MrCode

Re: some simple questions - 09/10/07 02:53

Look up "window" in the manual. That should be what you're after.
Posted By: G_Tos

Re: some simple questions - 09/10/07 09:22

Maybe you should define the panel with:
panel* panelname;
Posted By: Spirit

Re: some simple questions - 09/10/07 13:21

You can change pos_x in a function, like this:

PANEL* panelname = { .... }

var x = 10;

...
panelname.pos_x = x;
Posted By: TSG_Torsten

Re: some simple questions - 09/10/07 13:58

Why you dont change the scale of the panel?

var health=100; // Save the health to this var

panel health_pa
{
flags=visible; //make it visible
bmap="health.tga"; // Graphic
}

starter set_health
{
while(1)
{
health_pa.scale_x=health/100;
if(health_pa.scale_x<0.01)
{
health_pa.scale_x=0.01;
}
wait(1);
}
}

Regards
TSGames
Posted By: EpsiloN

Re: some simple questions - 09/10/07 16:38

pos...scale...Why dont you just use hbar?! This way you could use the panels bmap for background...
Posted By: tuschcarsten

Re: some simple questions - 09/10/07 17:26

because hbar is officially not supported by newer engine versions

i use window instead
Posted By: onslaught147

Re: some simple questions - 09/10/07 22:30

thanks the scale_x really helped
© 2024 lite-C Forums