5 registered members (AndrewAMD, alibaba, Konsti, 2 invisible),
1,418
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Stupid Question about dynamicaly sizing panels
#261917
04/21/09 01:38
04/21/09 01:38
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
I keep really to give my panel a variable for the size. But when the engine compiles my script it tells me it's looking for a number and not a var. So how else am i supposed to make my health bar??
Sorry this is a lame question, but i've rarely done anything with panels.
-Johnny Thrash
|
|
|
Re: Stupid Question about dynamicaly sizing panels
[Re: Spirit]
#261919
04/21/09 01:52
04/21/09 01:52
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
I don't know. Here's what I have, it won't work.
bmap bmap_background = <healthbar.bmp>;
panel panel_editor{
pos_x = 0;
pos_y = 0;
layer = 1;
size_x = playerhealth;
window(10,50,122,7,bmap_background,0,0);
flags = visible, transparent;
}
-Johnny Thrash
|
|
|
Re: Stupid Question about dynamicaly sizing panels
[Re: Metal_Thrasher]
#261928
04/21/09 05:03
04/21/09 05:03
|
Joined: Jul 2008
Posts: 553 Singapore
delinkx
User
|
User
Joined: Jul 2008
Posts: 553
Singapore
|
on defining the panel, u cannot put a variable assigned to the size. But on run time u do can change that. here is an example:
BMAP* bmap_background = "healthbar.bmp";
PANEL* panel_editor =
{
pos_x = 0;
pos_y = 0;
layer = 1;
size_x = 1;
bmap = bmap_background;
flags = SHOW;
}
funtion main()
{
...
...
panel_editor->size_x += healthgained;
panel_editor->size_x -= healthlost;
....
}
this way on runtime u can modify the size.
|
|
|
Re: Stupid Question about dynamicaly sizing panels
[Re: delinkx]
#262345
04/23/09 08:22
04/23/09 08:22
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
Okay, I don't why, but why the hell do my post keep getting moved to the lite-c forum?! Did the person that moved this maybe consider that I posted it in C-scipt because that's what kind of code it is? I don't what to confuse people. Anyway, sorry, the code you wrote me is lite-c, but I think i can convert it. But I may have been wrong all along. i think I want to change the x-size of the window part and not the panel
-Johnny Thrash
|
|
|
Re: Stupid Question about dynamicaly sizing panels
[Re: Metal_Thrasher]
#262585
04/24/09 18:40
04/24/09 18:40
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
This isn't working my panel is staying the same size no matter what??
-Johnny Thrash
|
|
|
Re: Stupid Question about dynamicaly sizing panels
[Re: Metal_Thrasher]
#262610
04/24/09 21:32
04/24/09 21:32
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Have you tried simply panel_editor.size_x += healthgained; panel_editor.size_x -= healthlost;
If that doesnt help, try putting a wait(1); in after any size change.
If even THAT doesnt help, try (both lines together)) reset(panel_editor,SHOW); set(panel_editor,SHOW);
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Stupid Question about dynamicaly sizing panels
[Re: EvilSOB]
#262923
04/27/09 02:37
04/27/09 02:37
|
Joined: Oct 2003
Posts: 2,194 Saturn
Metal_Thrasher
OP
Expert
|
OP
Expert
Joined: Oct 2003
Posts: 2,194
Saturn
|
Have you tried simply panel_editor.size_x += healthgained; panel_editor.size_x -= healthlost;
If that doesnt help, try putting a wait(1); in after any size change.
If even THAT doesnt help, try (both lines together)) reset(panel_editor,SHOW); set(panel_editor,SHOW); Never mind i got it, your suggestion worked, thanks a lot dude.
-Johnny Thrash
|
|
|
|