-
Using 1.9.6-b6, I've been trying to set a default skin for my game, and I'm currently unclear as to what is the way to do it. I followed the documentation and created a simple skin: init {
skin {
textButton {
font = BitmapFont()
fontColor = Color.WHITE
}
} But then when I create a TextButton: table {
textButton("Tutorial")
} I get an error that there is no
When saving the skin as a variable and passing it to the button, it works fine. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
See the Scene2D documentation. It's the first code snippet in the examples section. You have to set the init {
Scene2DSkin.defaultSkin = skin {
textButton {
font = BitmapFont()
fontColor = Color.WHITE
}
}
} |
Beta Was this translation helpful? Give feedback.
-
I think I got the wrong impressing while reading the Style docs that calling Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks! BTW, is there a good open source reference project you would suggest I study at to get a good idea of the the best practices? |
Beta Was this translation helpful? Give feedback.
-
Best practices of LibGDX in general or just KTX? There are a few open-sourced KTX projects listed on the official website, but most of them are quickly hacked game jam projects that just work (TM). I suggest looking into existing Java LibGDX tutorials and gradually converting your code to Kotlin. |
Beta Was this translation helpful? Give feedback.
See the Scene2D documentation. It's the first code snippet in the examples section. You have to set the
Scene2DSkin.defaultSkin
first in order to use methods without passing your skin explicitly.