1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

FormSpec: 9-slice images, animated_images, and fgimg_middle (#12453)

* FormSpec: 9-slice images and animated_images

* Add fgimg_middle; clean up code

* Address issues, add tests

* Fix stupid error; bump formspec version

* Re-add image[] elements without a size
This commit is contained in:
Vincent Robinson 2022-07-03 05:52:26 -07:00 committed by GitHub
parent 5a562a597c
commit f7bcf7fa46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 222 additions and 204 deletions

View file

@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiButton.h"
#include "IGUIButton.h"
#include "guiAnimatedImage.h"
using namespace irr;
@ -32,12 +33,11 @@ public:
s32 id, core::rect<s32> rectangle, ISimpleTextureSource *tsrc,
bool noclip = false);
void setForegroundImage(video::ITexture *image = nullptr);
void setForegroundImage(video::ITexture *image = nullptr,
const core::rect<s32> &middle = core::rect<s32>());
//! Set element properties from a StyleSpec
virtual void setFromStyle(const StyleSpec& style) override;
virtual void setScaleImage(bool scaleImage=true) override;
virtual void setFromStyle(const StyleSpec &style) override;
//! Do not drop returned handle
static GUIButtonImage *addButton(gui::IGUIEnvironment *environment,
@ -47,5 +47,5 @@ public:
private:
video::ITexture *m_foreground_image = nullptr;
gui::IGUIImage *m_image;
GUIAnimatedImage *m_image;
};