11

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

Daahrien
10.3k7 gold badges42 silver badges74 bronze badges
asked Jun 2, 2011 at 16:47

3 Answers 3

14

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.

answered Jun 2, 2011 at 17:08
Sign up to request clarification or add additional context in comments.

2 Comments

Did you follow the link I posted?
7

I'm writing a libgdx tutorial for beginners. This post might be useful to you: libgdx Tutorial: scene2d

answered Mar 1, 2012 at 12:50

Comments

3

Button is an Actor, so it is used with Stage. There is official documentation for scene2d. Button is in scene2d.ui, which is a UI framework on top Stage, which is a general purpose 2D scene graph. There is no official documentation for scene2d.ui yet. You can see UITest though.

answered Mar 13, 2012 at 2:14

1 Comment

Now official documentation for scene2dui. code.google.com/p/libgdx/wiki/scene2dui

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.