开发者

How to draw Button class in libgdx

I know that libgdx has this Button class t开发者_如何学Pythonhat 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


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜