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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -