LibGDX initializes Drawable

This is a question for those who are familiar with the new LibGDX 0.98. I'm not quite sure how to use Drawable in the Scene2d package. My current code for using ".png" as the background for different classes is as follows:

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

Is there an easier way to use ".png" as Drawable than with these three classes?

+8
java libgdx scene2d
source share
2 answers

As we read the API , we see that there are no more options for drawing the image as you want.

libGDX simplifies the job, but you should think that against the background of this library there is a lot of complex OpenGL logic that cannot be simplified more than these functions actually do.

Here I leave a link on the libGDX wiki, where they explain with examples some of the features of the Scene2d package. Perhaps this may be helpful.

+7
source share
 new Image(new Texture(...)).getDrawable(); 
+6
source share

All Articles