简体   繁体   中英

Libgdx | Scene2d | How to use actions on an animation

How would I go about using actions (eg...fade in/fade out) on an animation? Would I have to set the fade in/out on each individual texture in the animation at once?

Add the animation to an Actor and add the action on it.

public class AnimationWithAction extends Actor {
    Animation animation = new Animation(5, textures);
}

AnimationWithAction anim = new AnimationWithAction();
anim.addAction(youraction);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM