mercredi 31 décembre 2014

How to draw texture from imputProcessor class? LibGDX


Vote count:

0




I try drawing stuff using InputProcessor class of LibGDX. But nothing is drawn! Can I draw textures from any other place rather than render () class in LibGDX?


And yes, if I draw in render () class it is drawn ok, but can I draw from somewhere else, like InputProcessor touchDragged?


here is my code



public class mm_imput implements InputProcessor {

SpriteBatch batch=new SpriteBatch();
Texture pixel=new Texture("something.png");

@Override
public boolean touchDragged (int x, int y, int pointer) {

drawSomething();

}
void drawSomething() {
batch.begin();
batch.draw(pixel, 100, 100, 100, 100);
batch.end();
}


}


I should be showing something every time I drag mouse. How to achieve this?



asked 25 secs ago







How to draw texture from imputProcessor class? LibGDX

Aucun commentaire:

Enregistrer un commentaire