[LibGDX] Get the size of the Group

Hi! I’m new to LibGDX, and trying to make a game.

So, the problem is that I can’t get the actual size of the Group. Maybe I have just misunderstood its purpose.
Simplified parts of code:

// === init code (in custom Stage class)
menu = new Group();
logo = new Image(Assets.getTexture("logo"));
... other actors ...
menu.addActor(logo);
this.addActor(menu);

// === update code (on resizing window, for example) (in custom Stage class)
logo.setX((int) -logo.getWidth() / 2);
logo.setY(0);
... other actors ...

menu.setX((int) this.getWidth() / 2);
menu.setY((int) this.getHeight() / 2 - (int) menu.getHeight() / 2); // (!) menu.getHeight() is 0
this.draw();

So, the problem is that width and height of the group are 0. I can’t understand why.
And after hours of googling, I decided to ask here.

Thank you!

try getMinWidth()/getMinHeight()

Unfortunately, Group class doesn’t have these methods. Only Image class.
Did I understand you right?

Try using a Table instead of a Group

Well technically speaking, you could always modify using an anonymous inner type.

		final ArrayList<String> list = new ArrayList<String>() {
			private static final long serialVersionUID = 1L;

			@Override
			public boolean add(String t) {
				super.add(t);
				System.out.println("bar");
				return true;
			}
		};
		
		list.add("foo");
		
		System.out.println(list.get(0));

If super.add is add, then you will get a recursive stack overflow.