LIBGDX- getting position of an actor inside a table

Viewed 1689

Well the title says it all, I want to get the position of an actor inside a table

Button button = new Button(bs);

table.add(button).width(50).height(50);

table.top().center();

Thanks in advance.

edit: with button.localToStageCoordinates(new Vector2(button.getX(), button.getY())); i get a near position but not exact, here is an screen shot, red squares are the positions im getting, while the transparent squares are the buttons.

enter image description here

2 Answers
Related