Actions of Actors in libgdx

后端 未结 3 1573
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 22:45

I have made my Actor, but I am unclear on how to take advantage of the action and act methods. Outside of the basic Javadoc, I have not found a go

3条回答
  •  醉梦人生
    2020-12-12 23:39

    Here is a useful link for the uses of Class com.badlogic.gdx.math.Interpolation. So for example, to create a moveTo ation with an effect you could simply use:

    myActor.addAction(Actions.moveTo(100, 200, 0.7f, Interpolation.bounceOut));
    

    If you set your Actions class import as static (you have to set it manually):

    import static com.badlogic.gdx.scenes.scene2d.actions.Actions.*;
    

    then, you can use your actions like this:

    myActor.addAction(moveTo(100, 200, 0.7f, Interpolation.bounceOut)); 
    

提交回复
热议问题