Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by NeoDumont. 11/17/25 09:56
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, Quad, VoroneTZ), 8,658 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Set variable's value when I have changed the slider's position #238700
11/29/08 13:10
11/29/08 13:10
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
I'm trying to do all my previous learning by heart and I'm practising panels.

Right now I have stuck into one thing. I have a slider which changes max_health value. Now I need to change health value to max_health value only when I have changed slider position. On other time I can change health as I wish and max_health stays the same.


New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Re: Set variable's value when I have changed the slider's position [Re: Crypton] #238838
11/30/08 15:45
11/30/08 15:45
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
Right now I can only set health variable each time I press mouse button somehwere on the panel:

Code:
...
function set_health()
{
	if (health != max_health)
	{
		health = max_health;
		win_x = (health_width*health)/max_health;
		win_x = health_width - win_x;
	}
}

...

PANEL* my_panel =
{
...
hslider(30,117, 148, s_slider, 10, 200, max_health);
	
	on_click = set_health; //Hiirenupu vajutusel muudame elud samaks kui max_health
...
}


But how can I change health to max_health only when I have pressed the mouse button from slider?


New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK

Gamestudio download | 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