I wish to rotate my picture in touch, however I by no means apply motion, I’m utilizing rotatetoaction to attain this.
class actorCark extends Actor
{
Texture texture;
Sprite sprite;
International g;
GetActorByName a;
public actorCark()
{
ses=new sesler();
g=new International();
a=new GetActorByName();
sr=new soruSor();
texture=new Texture(Gdx.information.inner("pictures/carkifelek.png"));
sprite=new Sprite(texture);
setBounds(International.screen_width / 2 - International.screen_height * 0.9F * sprite.getTexture().getWidth() / sprite.getTexture().getHeight() / 2, International.screen_height / 2 - International.screen_height * 0.9F / 2, International.screen_height * 0.9F * sprite.getTexture().getWidth() / sprite.getTexture().getHeight(), International.screen_height * 0.9F);
setTouchable(Touchable.enabled);
addListener(new InputListener() {
public boolean touchDown(InputEvent occasion, float x, float y, int pointer, int buttons) {
clearActions();
RotateToAction rotateToAction=new RotateToAction();
rotateToAction.setRotation(360);
rotateToAction.setDuration(2);
addAction(rotateToAction);
dondur();
sesler.donmeS.play();
return true;
}
});
}
@Override
public void act(float delta) {
tremendous.act(delta);
}
public void draw(Batch batch, float alpha)
{
sprite.getTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
sprite.setBounds(International.screen_width / 2 - International.screen_height * 0.9F * sprite.getTexture().getWidth() / sprite.getTexture().getHeight() / 2, International.screen_height / 2 - International.screen_height * 0.9F / 2, International.screen_height * 0.9F * sprite.getTexture().getWidth() / sprite.getTexture().getHeight(), International.screen_height * 0.9F);
sprite.setOrigin(sprite.getWidth() / 2, sprite.getHeight() / 2);
sprite.draw(batch);
}
}