Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,232 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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