Add a background to a Vertical Group

How can one go about adding a background to a LibGDX Vertical Group?

I’ve checked the documentation for the class and it seems like there isn’t a clean way to do so.


You can add an Image actor to a Group, then add the Vertical Group to said Group. If you set the Group’s dimensions to that of the Image actor, then set the Vertical Group to fill its parent, then you have effectively added a background to a Vertical Group.


Group g = new Group();

Image i = new Image(new Texture("pathtosomeimage.png"));

VerticalGroup vg = new VerticalGroup();

g.setSize(i.getWidth(), i.getHeight());


//add stuff to the Vertical Group

Leave a Reply

Your email address will not be published. Required fields are marked *