G
The actors are moving to a certain point on the screen. Actions.moveTo( Gdx.graphic.getWidth() / 2.0, Gdx.graphic.getHeight() / 2.0, 2.0f /**seconds*//*, Interpolation.linear */ );
And adding ecchiones to actors with Container's help. Container<Actor> tankContainer = new Container<Actor>( tank );
tankContainer.addAction( Actions.sequence(
Actions.moveTo( 0, Gdx.graphic.getHeight() / 2.0 ),
Actions.moveTo( Gdx.graphic.getWidth() / 2.0, Gdx.graphic.getHeight() / 2.0, 2.0f /*seconds*//*, Interpolation.linear */ ) );
mStage.addActor( tankContainer );
Container<Actor> tankContainer_2 = new Container<Actor>( tank_2 );
tankContainer_2.addAction( Actions.sequence(
Actions.moveTo( Gdx.graphic.getWidth(), Gdx.graphic.getHeight() / 2.0 ),
Actions.moveTo( Gdx.graphic.getWidth() / 2.0, Gdx.graphic.getHeight() / 2.0, 2.0f /seconds//*, Interpolation.linear */ ) );
mStage.addActor( tankContainer_2 );
в render'е
mStage.act( delta );
mStage.draw();
And in Tank's class, we need to use the methods for the tank drawer position. getX() и getY()
And if you want to turn the tanks,tankContainer_2.addAction( Actions.rotateBy(...) );
and if the Tank class is painted, getRotation()
In order to capture the compression anywhere, the screen can be traced from InputProcessor, and Gdx.input.setInputProcessor better use InputMultiplexer InputMultiplexer input = new InputMultiplexer();
input.add( mStage );
input.add( this );
Gdx.input.setInputProcessor( input );