Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LibGDX initialize Drawable

This is a Question for those who are familiar with the new LibGDX 0.98. I'm not quite sure, how to use a Drawable in the Scene2d package. My current code for using a ".png" as a Background for various classes looks like this:

new TextureRegionDrawable(new TextureRegion(new Texture("data/splitpane.png")));

Is there any easyer way to use a ".png" as Drawable than with these 3 classes?

like image 981
Xerusial Avatar asked Jul 01 '13 07:07

Xerusial


1 Answers

Reading the API we can see that there aren't more options to draw an image as you want.

libGDX makes things a lot easier, but you have to think that in the background of this library there are lots of OpenGL complex logic that cannot be simplified more than these functions actually do.

Here I leave a link to the wiki of libGDX where they explain with examples some of the functions in Scene2d package. Maybe this could be useful.

like image 84
maqjav Avatar answered Oct 17 '22 10:10

maqjav