I am trying to use Nine Patch as the background for the Libgdx Scene2d user interface. This is loading, but it is really ugly. I see pixels of "metadata", and it is stretched, as if it were just an ordinary image (text on the "Continue" button):

I upload .9.png files directly to (libgdx) NinePatchDrawable via (libgdx) NinePatch as follows:
this.dialogButtonUp = new NinePatchDrawable( new NinePatch(new Texture(Gdx.files.internal("data/button-round.9.png")))); this.dialogButtonDown = new NinePatchDrawable( new NinePatch(new Texture(Gdx.files.internal("data/button-round-down.9.png"))));
Then I create a TextButtonStyle that describes the button, and references two NinePatch drawables:
TextButton.TextButtonStyle buttonStyle = new TextButton.TextButtonStyle(); buttonStyle.font = aValidFontReally; buttonStyle.fontColor = Color.BLACK; buttonStyle.up = this.dialogButtonUp; buttonStyle.down = this.dialogButtonDown; buttonStyle.pressedOffsetX = -2;
I create the button indirectly through the Dialog field:
new Dialog( ... ).button("Continue", null, buttonStyle);
I checked the .9.png files to make sure that:
- that asset files have been updated in eclipse
- so that the pixels of the metadata border are either completely invisible or completely visible-black
- that the Android
draw9patch can download images and check them
Any other suggestions for checking or changing?
source share