java - libdgx how to set style of TextButton? -
using uiskin.json default
it contains
com.badlogic.gdx.scenes.scene2d.ui.label$labelstyle: { default: { font: default-font, fontcolor: white } }, com.badlogic.gdx.scenes.scene2d.ui.textbutton$textbuttonstyle: { default: { down: default-round-down, up: default-round, font: default-font, fontcolor: white }, toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontcolor: white, downfontcolor: red } },
--
skin = new skin(gdx.files.internal("data/uiskin.json")); textbutton button = new textbutton("my button",skin);
if clicked, change color using button.setcolor(color.red);
works well.
if clicked again, want change default style. wrote following causes error
button.setstyle(new textbutton.textbuttonstyle());
the error is:
fatal exception glthread 2812 java.lang.illegalruntimeexception: missing labelstylefont
i have files default.fnt , default.png in assets folder already. please enlighten me!
wouldn't have textbutton.getstyle() style?
Comments
Post a Comment