Home | About | Account | Forums | Games
Guest   | Login
  Index  | Recent Threads  | Register  | Search  | Help  | RSS feeds  | View Unanswered Threads  
  Search  


Quick Go »
Thread Status: Normal
Forum Status: Locked
Total posts in this thread: 3
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 2122 times and has 2 replies Next Thread
gemedet
Stranger



Joined: Jan 1, 2008
Posts: 4
Status: Offline

How to use FadeImageAnimation?

Hi,

I've been trying to get an image to fade in my game, but so far it doesn't work:

FadeImageAnimation fia = new FadeImageAnimation(IconManager.getInstance().getIcon(piece),loc.x,loc.y,100f,-.1f,0f);
fia.addAnimationObserver(this);
fia.setRenderOrder(2);
addAnimation(fia);

The getIcon() just returns a Mirage object. I know that part works at least, because I can get a ScaleAnimation to work just fine, with similar code.

Is there some special trick to getting fades to work? Thanks.
[Feb 23, 2008 4:36:53 PM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
aduros
Newbie



Joined: May 2, 2007
Posts: 32
Status: Offline

Re: How to use FadeImageAnimation?

What exactly is the problem? Is it not fading at all or just disappears suddenly? If it's just disappearing, try lowering the step value (By a lot!) to get a slower fade-out.

Someone has put together a demo of all the different Animations, check it out with CVS using:

cvs -d :pserver:anonymous@skovran.com:/usr/local/cvsroot co mediatest

[Feb 25, 2008 5:42:04 AM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
gemedet
Stranger



Joined: Jan 1, 2008
Posts: 4
Status: Offline

Re: How to use FadeImageAnimation?

Thanks, that demo code helped a lot. I was just using really wrong values for the alpha and step. I changed it to

new FadeImageAnimation(IconManager.getInstance().getIcon(piece),loc.x,loc.y,1f,-.002f,0f);

...and it works fine.
[Feb 25, 2008 4:06:39 PM] Show Printable Version of Post        Send Private Message [Link]  Go to top 
[Show Printable Version of Thread]

Home | About | Account | Forums | Games           ©2005 Three Rings Design, Inc