Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 12:10 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jul 06, 2007 6:10 pm 
Offline
Game Developer
User avatar

Joined: Tue Nov 21, 2006 4:46 am
Posts: 619
Location: Iceland
In FadeOutTransition, used to fade in/out between states, it would be cool to be able to define how long each transition takes. Now it's hardcoded.

Example:
Code:
game.enterState(IntroState.ID, new FadeOutTransition(Color.black, 5000), new FadeInTransition(Color.black), 2000);


FadeOut takes 5000 ms, but FadeIn takes 2000 ms. (or whatever time unit Slick is using, float is fine).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 7:12 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
If I remember correctly the implementations of FadeInTransition and FadeOutTransition were only examples.

You can easily subclass those (TimedFadeInTransition for example).
Important are the methods isComplete() where you define your termination condition and update() where you would deal with increasing color alpha and your passed time...

But if more people vote for it a second constructor expecting a fading duration could be added to FadeInTransition and FadeOutTransition...

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 9:22 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Tis in next build.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group