Je suis un peu confus au sujet de la manipulation tactile de libGDX. J'ai vu l'utilisation de tous les trois types.libGDX quelle est la différence entre InputListener, InputProcessor, InputAdapter
InputProcessor: http://www.gamefromscratch.com/post/2013/10/24/LibGDX-Tutorial-5-Handling-Input-Touch-and-gestures.aspx
public class InputDemo2 implements ApplicationListener, InputProcessor {
@Override
public void create() {
Gdx.input.setInputProcessor(this);
}
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
}
}
InputListener
ici: http://www.gamefromscratch.com/post/2013/11/27/LibGDX-Tutorial-9-Scene2D-Part-1.aspx
public MyActor(){
setBounds(actorX,actorY,texture.getWidth(),texture.getHeight());
addListener(new InputListener(){
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
((MyActor)event.getTarget()).started = true;
return true;
}
});
}
InputAdapter
ici: LibGdx, How to handle touch event?
public class Prac1 extends ApplicationAdapter {
@Override
public void create() {
Gdx.input.setInputProcessor(new InputAdapter(){
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
return true;
}
});
}
}
Je ne trouve pas un différent d'un autre. Lequel dois-je utiliser? Merci