Problem with Nifty-gui panel borders

I’ve read through the other threads regarding this, but I’m still not clear on the solution. I’m trying to add a plain old border to a panel. No rounded corners or anything fancy. Since there doesn’t appear to be any way to do that without setting a background image, I’m using a background image, 30x30 pixels, with a one-pixel border around it.

My nifty screen looks like this:
[java] <screen id="test">
<layer id="layer" childLayout="center">
<panel backgroundImage="res/img/border-1px-solid-336699.png"
imageMode="resize:10,10,10,10,10,10,10,10,10,10,10,10" childLayout="center">
<text style='nifty-label' text="Testing."
align="center" />
</panel>
</layer>
</screen>

[/java]

But the right and bottom borders are not being displayed. Can someone tell me what I’m doing wrong?

(I know this sounds like a “troubleshooting request”, and those aren’t allowed here, but I’m not sure where else to post this. Sorry!)

If you just want a 1 pixel border then use a 4x4 image and imagemode 1,2,1,1,1,2,1,2,1,2,1,1

All I can say is you are trying the right way so you must have something wrong in your image or your numbers for the image mode.

Have you tried:

[java]
Panel panel = new Panel (screen, new Vector2f(50,50));
screen.addElement(panel);
[/java]

?

Wait for it…

Waaaaait for it…

Seriously though… the imagemode stuff looks correct considering the image size. Buuuut, for the sake of testing that, have you tried:

1,28,1,1,1,28,1,28,1,28,1,1

At least you can say that this is not the problem if you still have the same results.

@t0neg0d said: for the sake of testing that, have you tried:

1,28,1,1,1,28,1,28,1,28,1,1

At least you can say that this is not the problem if you still have the same results.

I DID try this… and it worked! Then I “backed it out” to 2, 26, 2, then 5, 20, 5, then all the way back to 10,10,10, and it all works fine now. No idea what was wrong, but everything magically fixed itself.

…I hate when that happens. Now I’ll never know what I was doing wrong. Thanks for the help, though!

@roach374 said: I DID try this... and it worked! Then I "backed it out" to 2, 26, 2, then 5, 20, 5, then all the way back to 10,10,10, and it all works fine now. No idea what was wrong, but everything magically fixed itself.

…I hate when that happens. Now I’ll never know what I was doing wrong. Thanks for the help, though!

Unfortunately, I’m not familiar with how Nifty builds it’s meshes… though I would assume they are nothing more than 16 vert quad grids. Maybe the issue is in the parser for imagemode. If you can put together a simple example of it not working, it should be easy to get someone who has access to the sources to review it for issues (I would think).