| Home | About | Account | Forums | Games |
| Guest | Login |
|
Index
| Recent Threads
| Register
| Search
| Help
| |
![]() |
Forums » List all forums » Forum: Tutorials and Help » Thread: How to use FadeImageAnimation? |
|
Thread Status: Normal Forum Status: Locked Total posts in this thread: 3 |
[Add To My Favorites] [Watch this Thread] |
| Author |
|
|
gemedet
Stranger
|
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. |
||
|
|
aduros
Newbie
|
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 |
||
|
|
gemedet
Stranger
|
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. |
||
|
| [Show Printable Version of Thread] |
| Powered by mvnForum 1.1 dev (Build: 15 April 2006) - Copyright © 2002-2006 by MyVietnam.net |
