Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,310 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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 Offline OP
Expert
Metal_Thrasher  Offline 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: Metal_Thrasher] #261918
04/21/09 01:43
04/21/09 01:43
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
my_panel.size_x = new_size?

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 Offline OP
Expert
Metal_Thrasher  Offline OP
Expert

Joined: Oct 2003
Posts: 2,194
Saturn
I don't know.

Here's what I have, it won't work.
Code:
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 Offline
User
delinkx  Offline
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:

Code:
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.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
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 Offline OP
Expert
Metal_Thrasher  Offline 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 blush


-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 Offline OP
Expert
Metal_Thrasher  Offline 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 Offline
Expert
EvilSOB  Offline
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 Offline OP
Expert
Metal_Thrasher  Offline OP
Expert

Joined: Oct 2003
Posts: 2,194
Saturn
Originally Posted By: EvilSOB
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
Re: Stupid Question about dynamicaly sizing panels [Re: Metal_Thrasher] #262924
04/27/09 02:44
04/27/09 02:44
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Not a problem.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1