-
I just wanted to do the thing from #306 with For example, this doesn't work: class MyWindow(...) : Window(...), KWindow { ... } |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is because @Scene2dDsl
class KWindow(title: String, skin: Skin, style: String) : Window(title, skin, style), KTable Instead of extending |
Beta Was this translation helpful? Give feedback.
This is because
KWindow
is a concrete class of a widget, whileKTable
(from the linked example) is an interface that adds the DSL. Windows are actually just fancy tables in LibGDX - if you look into theKWindow
implementation, you'll see that it also implements theKTable
interface:Instead of extending
KWindow
, all you have to do is implementKTable
to get access to the DSL. When in doubt, check out which interfaces are implemented by the KTX widget. You can basically copy-and-paste the class and go from there.