summaryrefslogtreecommitdiff
path: root/src/gui/guiFormSpecMenu.h
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-06-22 15:03:54 +0100
committerSmallJoker <SmallJoker@users.noreply.github.com>2019-06-22 16:03:54 +0200
commit429a98964859b83016f2eb47a47a08ab8dc3c57e (patch)
treeb02a16132e5cdf6696917910921942c464bc39c6 /src/gui/guiFormSpecMenu.h
parent4e3c1916f731058a137ec1f9eecf2b7eff4d8fcc (diff)
downloadminetest-429a98964859b83016f2eb47a47a08ab8dc3c57e.tar.gz
minetest-429a98964859b83016f2eb47a47a08ab8dc3c57e.tar.bz2
minetest-429a98964859b83016f2eb47a47a08ab8dc3c57e.zip
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
Diffstat (limited to 'src/gui/guiFormSpecMenu.h')
-rw-r--r--src/gui/guiFormSpecMenu.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h
index ccd9cb753..b1ca9a48a 100644
--- a/src/gui/guiFormSpecMenu.h
+++ b/src/gui/guiFormSpecMenu.h
@@ -177,6 +177,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),
parent_button(NULL),
@@ -191,6 +203,7 @@ class GUIFormSpecMenu : public GUIModalMenu
gui::IGUIButton *parent_button;
v2s32 pos;
v2s32 geom;
+ core::rect<s32> middle;
bool scale;
bool clip;
};