Here is my code:
@Override public void resize(int width, int height) { super.resize(width, height); stage.clear();
I create a simple game, and that is how I create the main menu. I want to make my startImage tangible (clickable) since there is no listener available for the Image class. How can I do it? Or is it better to use ImageButton? Thus, I would need to create an image atlas, which for me is now a little more complicated.
EDIT: I tried the following:
startImage.addListener(new ClickListener() { public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { game.setScreen(new SplashScreen(game)); return true; } });
But it still doesn't work.
EDIT:
Gdx.input.setInputProcessor(stage);
need to call. Solvable.
source share