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 (), 18,767 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
fade in and fade out of panel #323735
05/17/10 01:41
05/17/10 01:41
Joined: Mar 2010
Posts: 17
K
Kiko Offline OP
Warez kiddie
Kiko  Offline OP
Warez kiddie
K

Joined: Mar 2010
Posts: 17
Hi,

Please help me how to make the panel fade in and out. I have a main menu and buttons, when I press a certain button , I want the main menu fade out and fade in the next menu and proceed.

Thanks

Re: fade in and fade out of panel [Re: Kiko] #323736
05/17/10 01:53
05/17/10 01:53
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Set the panel transparent, its alpha value to 100 and decrease it using a while loop (you may want to set the UNTOUCHABLE flag, too, when fading in/out). Proceed in the same way for fading in.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: fade in and fade out of panel [Re: Superku] #323737
05/17/10 02:43
05/17/10 02:43
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
>>>>for lite-c.. for c-script i dont remember lol i un-learned that already.

Code:
//mode 0= fade in, mode=1 fade out
function panel_fade(PANEL* p,int mode,int speed){
int check;
p.alpha=100*mode; //assume the init value as a the mode is zero or 1
set(p,TRANSLUCENT);

while(p && check==0){
check=1; // turn 1, as finished loop
if(mode==0 && p.alpha<100){p.alpha+=speed*time_step; check=0;}
if(mode==1 && p.alpha>0){p.alpha-=speed*time_step; check=0;}
wait(1);
}

}



to call the action you just do:

panel_fade("panel_here" , 0,speed );
example: panel_fade(button,1,4);

i recommend the speed to be between 1 and 25..



[*]if you are assigning this to the button you, the button you press is passed as 1st parameter , but the speed i dont know if you can send it like that. if you are assigning this to the button you, the button you press is passed as 1st parameter , but the speed i dont know if you can send it like that.


Last edited by MMike; 05/17/10 02:48.

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