Answer the question
In order to leave comments, you need to log in
Libgdx click area in non button?
Skin skin = new Skin();
skin.add("simpleButton", new TextureRegion(atlas.findRegion("Simpl")));
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("simpleButton", Color.DARK_GRAY);
textButtonStyle.down = skin.newDrawable("simpleButton", Color.DARK_GRAY);
textButtonStyle.over = skin.newDrawable("simpleButton", Color.LIGHT_GRAY);
textButtonStyle.font = font24;
//кнопки
final Group group = new Group();// группа для кнопок
final Group group2 = new Group();
// группа для кнопок
final TextButton pausedButton = new TextButton("Pause", textButtonStyle);
final TextButton exitButton = new TextButton("Exit", textButtonStyle);
pausedButton.setPosition(0, 40);
exitButton.setPosition(0, 0);
group.addActor(pausedButton); // засунем все кнопки в группу
group.addActor(exitButton);
group.setPosition(Gdx.graphics.getWidth() - 140, Gdx.graphics.getHeight() - 80); // перемещаем всю группу кнопок целиком
stage.addActor(group);
Gdx.input.setInputProcessor(stage);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question