An arbitrary solution for setting the background color of libGDX Tables.
BackgroundColor backgroundColor = new BackgroundColor("white_color_texture.png");
backgroundColor.setColor(2, 179, 228, 255); // r, g, b, a
table.setBackground(backgroundColor);
Where table
is an instance of a libGDX Table, com.badlogic.gdx.scenes.scene2d.ui.Table
, and "white_color_texture.png"
is an arbitrary name of a PNG file located in the project's root resource directory, which is /android/assets/ by default.
This repo is used for the following solution:
-and is a back-up to:
http://www.snip2code.com/Snippet/2615417
Feel free to make pull requests. The purpose of this repository is to help others. There are no emotions attached here.