How to draw Button class in libgdx

Fugogugo picture Fugogugo · Jun 2, 2011 · Viewed 12.7k times · Source

I know that libgdx has this Button class that seems so easy to use, but I wonder why the draw method is set protected?

In that case, how should I draw the button?

Scene2d Button

Answer

CaseyB picture CaseyB · Jun 2, 2011

Button is also an Actor. So you would put it on the Stage and the framework would draw it. Here is some more documentation on how this fits together.