1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add support for 9-sliced backgrounds (#8600)

9-slice textures are commonly used in GUIs to allow scaling them to match any resolution without distortion.

https://en.wikipedia.org/wiki/9-slice_scaling
This commit is contained in:
rubenwardy 2019-06-22 15:03:54 +01:00 committed by SmallJoker
parent 4e3c1916f7
commit 429a989648
5 changed files with 137 additions and 13 deletions

View file

@ -176,6 +176,18 @@ class GUIFormSpecMenu : public GUIModalMenu
{
}
ImageDrawSpec(const std::string &a_name,
const v2s32 &a_pos, const v2s32 &a_geom, const core::rect<s32> &middle, bool clip=false):
name(a_name),
parent_button(NULL),
pos(a_pos),
geom(a_geom),
middle(middle),
scale(true),
clip(clip)
{
}
ImageDrawSpec(const std::string &a_name,
const v2s32 &a_pos):
name(a_name),
@ -191,6 +203,7 @@ class GUIFormSpecMenu : public GUIModalMenu
gui::IGUIButton *parent_button;
v2s32 pos;
v2s32 geom;
core::rect<s32> middle;
bool scale;
bool clip;
};