There is a class

class ActorListener extends InputListener { @Override public void touchUp(InputEvent event, float x, float y, int pointer, int button){ event.getListenerActor().setSize(140,140); } } 

and class

  class Dot extends Actor { @Override public void draw(Batch batch, float parentAlpha){ batch.draw(dotimg, getX(), getY(), getWidth(), getHeight()); } } 

and method creating points:

 public void initDots(){ for (int n1=0; n1 < 9; n1++) { for (int n = 0; n < 16; n++) { dot = new Dot(); dot.addListener(new ActorListener()); dot.setSize(40, 40); dot.setPosition(120 + n * 120, 120 + n1 * 120); stage.addActor(dot); } } } 

Why when I touch a point, the size of the point does not change, although I registered in ActorListener to change it ??

  • and launching in debugger mode to you for what in the development environment have you attached it? - rjhdby
  • useless tried. maybe I just wrote something wrong, and you will say exactly where, if you know, of course, yourself ... - ramazan793
  • And what did the debug show you? is the touchUp method called when touched? - rjhdby

1 answer 1

Maybe you forgot to write

 Gdx.input.setInputProcessor(stage); 
  • you're right, thank you - ramazan793
  • One more question, setSize works, but why does setColor not change the color of a dot? - ramazan793