Answer the question
In order to leave comments, you need to log in
How to work with 9Patch in libGDX?
I need to make a button with a stretchable background. I have a .9.png (nine patch) image file, but when I do this, the background is not stretched into nine patch , but just stretched like a picture and the quality is badly damaged. How to work in nine patch in libGDX? I checked this background in the Android SDK, everything works well there.
Drawable drawableButtonMessageUp = new TextureRegionDrawable(new TextureRegion(new Texture("data/message_my_g.9.png")));
ButtonStyle buttonStyleMessage = new ButtonStyle();
buttonStyleMessage.up = drawableButtonMessageUp;
Button buttonMessage = new Button(buttonStyleMessage);
Label labelMessage = new Label("", new LabelStyle(game.fonts[0], new Color(0, 0, 0, 1)));
buttonMessage.add(labelMessage);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question