I am trying to supplant an actor using Action FadeOut. However, I found that no actions work at all for my objects. The hierarchy of my classes is as follows:
Actor -> MoveableObject -> Knight
Stage -> KnightGroup (Group) -> Knight
The actions of my knight actors do not work at all. However, the actions for my KnightGroup work. Here is the code for my Knight:
public class Knight extends Players {
public Knight() {
setWidth(96);
setHeight(96);
setPosition(100, 90);
AlphaAction action = new AlphaAction();
action.setAlpha(0f);
action.setDuration(1f);
addAction(action);
addAction(fadeOut(1f));
addAction(Actions.scaleBy(1f, 1f));
}
@Override
public void act(float delta){
super.act(delta);
}
@Override
public void draw(Batch batch, float parentAlpha) {
batch.setColor(getColor().r, getColor().g, getColor().b, getColor().a);
batch.draw(animation[currentState], getX(), getY(), getWidth(), getHeight());
}
}
I canβt understand in my life what the problem is. Actions in MoveableObject(Knight's parent) also do not work. My best guess is that wrapping the actors in these participants Groupwill be render actionsinvalid. KnightGroupis a pretty important part of my code, although I will have to do a lot of refactoring to pull it out. Can someone else shed light on this issue?