I'm following some tutorial to create my own Inventory for my game. I have met with an insidious problem:
public class InventoryActor extends Window {
public InventoryActor(Inventory inventory, DragAndDrop dragAndDrop, Skin skin) {
super("Inventory", skin);
// add an "X" button to the top right of the window, and make it hide the inventory
TextButton closeButton = new TextButton("X", skin);
closeButton.addListener(new HidingClickListener(this));
getButtonTable().add(closeButton).height(getPadTop());
// basic layout
setPosition(400, 100);
defaults().space(8);
row().fill().expandX();
...
}
Everything in this code is neat and nice. There's one BUT -
getButtonTable().add(closeButton).height(getPadTop());
This method isn't implemented anywhere. Tutorial I'm following comes from 2014. Therefore I assume that it may be some deprecated/old method from Window class or something like that. My question is - is there any way I could repair it, and how can I add this 'X' close button to the window then? Should I use some other method? Regards and thanks in advance!