diff --git a/include/IGUIEnvironment.h b/include/IGUIEnvironment.h index 9522645f..05d7c40e 100644 --- a/include/IGUIEnvironment.h +++ b/include/IGUIEnvironment.h @@ -300,11 +300,13 @@ public: \param parent Parent gui element of the image. \param id Id to identify the gui element. \param text Title text of the image. + \param useAlphaChannel Sets if the image should use the alpha channel + of the texture to draw itself. \return Pointer to the created image element. Returns 0 if an error occurred. This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ virtual IGUIImage* addImage(const core::rect& rectangle, - IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; + IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0; //! Adds a checkbox element. /** \param checked Define the initial state of the check box. diff --git a/source/Irrlicht/CGUIEnvironment.cpp b/source/Irrlicht/CGUIEnvironment.cpp index bafd72be..fde2d909 100644 --- a/source/Irrlicht/CGUIEnvironment.cpp +++ b/source/Irrlicht/CGUIEnvironment.cpp @@ -1113,7 +1113,7 @@ IGUIImage* CGUIEnvironment::addImage(video::ITexture* image, core::position2d& rectangle, IGUIElement* parent, s32 id, const wchar_t* text) +IGUIImage* CGUIEnvironment::addImage(const core::rect& rectangle, IGUIElement* parent, s32 id, const wchar_t* text, bool useAlphaChannel) { IGUIImage* img = new CGUIImage(this, parent ? parent : this, id, rectangle); @@ -1121,6 +1121,9 @@ IGUIImage* CGUIEnvironment::addImage(const core::rect& rectangle, IGUIEleme if (text) img->setText(text); + if ( useAlphaChannel ) + img->setUseAlphaChannel(true); + img->drop(); return img; } diff --git a/source/Irrlicht/CGUIEnvironment.h b/source/Irrlicht/CGUIEnvironment.h index 9f130df5..4c2f6cb5 100644 --- a/source/Irrlicht/CGUIEnvironment.h +++ b/source/Irrlicht/CGUIEnvironment.h @@ -116,7 +116,7 @@ public: //! adds an image. The returned pointer must not be dropped. virtual IGUIImage* addImage(const core::rect& rectangle, - IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0); + IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true); //! adds a checkbox virtual IGUICheckBox* addCheckBox(bool checked, const core::rect& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0);