Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
2 registered members (AndrewAMD, VoroneTZ), 740 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | 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