more scene2d changes

Some new scene2d changes are in. Updating should be pretty easy to fix up.

  • Table saw some love: you can now set a background nine patch or texture region, set a click listener, and turn on clipping. This obsoleted the Pane class (just use a Table and call enableClipping()) and makes handling clicks easier.
  • Button was rewritten by extending Table, which allows any widgets you like to be placed in a button. It has convenience methods for setting the button text (it just adds a Label to the button for you). It also has a “checked” state that is toggled when clicked. These changes obsoleted the ToggleButton, ImageButton, and ImageToggleButton.
  • The CheckBox became much simpler by extending the new Button.
  • Because Pane and the *Button classes are gone, your skin will need to be fixed up. Just remove style entries for classes that are gone, and make sure your Button and CheckBox entries are correct. See the skin for the UITest class for an example.
  • For all widgets, “name” had to be moved to the last constructor parameter to avoid ambiguity with other constructors that take a String but not a name.

We still haven’t fixed the NPE you get when multitouching buttons. Sorry! We’ll get to this very soon.

Leave a Reply

Your email address will not be published.