9-slice scaling with DirectGUI

This example shows an undocumented feature of Panda’s GUI system: 9-slice scaling, which allows you to create themed buttons and frames that scale properly without the borders also getting stretched.

Download the code and assets here:
dgui-9slice.zip (86.4 KB)

Assets CC0, taken from OpenGameArt.

5 Likes

That… would have been rather useful to have known about before I implemented such a feature of my own! XD;

But this is quite impressive, and I’m glad to see that Panda supports it! :slight_smile:

(It might also be worth mentioning in the manual.)

@wolf: Does DirectGui Designer support this feature…? It seems like it could be a rather useful addition, if not!

1 Like

Super useful feature. Definitely needs to be in the manual.
Now I want to know what other hidden features direct has. :laughing:

This is an interesting feature. I knew of those parameters but never what they actually were used for. Thank you for mentioning me and thanks @rdb for the nice example. This sure is worth a mention in the manual.

The DirectGui Designer does support most properties available on DirectGui widgets, those for the texture border are also included.

1 Like

That is good to know–thank you! :slight_smile: