Question

I cannot use sequence at all, even THESE gives me an error.

this.AddAction(sequence());
this.AddAction(sequence(setX(getY())));

No matter what I do sequence won't work, despite these being imported. addAction does not work either, nor does addAction & Actions.sequence.. Nothing does as far as this goes.

import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.actions.AddAction;

Edit: I needed to make my class an Actor.

Was it helpful?

Solution

This worked fine for me.

Do this in your constructor of the screen where you want the action:

image.addAction(sequence(fadeOut(3), run(new Runnable() {
        @Override
        public void run() {
            game.setScreen(new MenuScreen(game));
        }
}));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top