# How to implement own UI widget in libGDX?

I want to implement my own widget, here is an image:

what I want to get. Instead of numbers there will be some names, but I think it doesn't matter. I'm pretty new in libGDX, so could you please briefly describe me plan, how can I do something like this (if there will be some code, it would be awesome)? I tried to google it, but didn't find something relevant.

 shapeRenderer.begin(ShapeType.Line);
shapeRenderer.setColor(1, 1, 0, 1);
shapeRenderer.line(x, y, x2, y2);
shapeRenderer.rect(x, y, width, height);
shapeRenderer.end();


Here is an example for the shapeRenderer class. I think that tree is a dynamic, a background image wouldn't work.

So you need to come up with an object oriented design or use a recursive function to draw it. How do you store your data? Without further information, supplying you with code is impossible.

Also did you get that image in libgdx, and are you asking to only write words instead of numbers? If that's the case use bitmap font. To use bitmap font look at the first link.

yourGame.font.draw(yourBatch, yourString, x, y);