Gamestudio Links
Zorro Links
Newest Posts
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
Pause button for evaluation shell?
by jcl. 08/07/26 11:43
Accepting new programming clients
by AndrewAMD. 08/06/26 21:25
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (AndrewAMD), 1,432 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19222 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