Skip to content

Scene2D builders inside constructors #306

Answered by czyzby
Divelix asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you have to implement the KTable interface:

import ktx.scene2d.KTable
import com.badlogic.gdx.scenes.scene2d.ui.Table

class MyTable: Table(), KTable {
  init {
    table { } // subTable1
    row()
    table { } // subTable2
  }
}

Since MyTable already extends Table, there aren't any extra methods that you have to override - all you have to do is to add the interface.

Similar interfaces exist for groups, trees, etc.

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by czyzby
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #306 on December 11, 2020 14:11.