// Создаем стиль для кнопки
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
// Переопределяем нужные параметры (например, up - картинка обычного состояния кнопки).
// Так же нужно задать font, опустил для краткости.
textButtonStyle.up = new TextureRegionDrawable(/*сюда передаем TextureRegion*/);
TextButton textButton = new TextButton("Тут текст кнопки", textButtonStyle);
带皮肤:
TextButton backButton = new TextButton("Текст кнопки", Utility.UI_SKIN, "default-button-with-background");
如果你想要一个带有背景和文本的按钮,一个普通的
TextButton.TextButtonStyle继承了常规按钮的特性,即具有背景图像。没有皮肤怎么办:
带皮肤:
在皮肤的json中: