Using IGUIImage by any chance? Had same problem, for some unknown reason it doesn't support alphablending. Try the patch here, it is what I am using the following changes to the engine ( fix by zola ):
IGUIImage.h
Code: Select all
// Copyright (C) 2002-2004 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
#ifndef __I_GUI_IMAGE_H_INCLUDED__
#define __I_GUI_IMAGE_H_INCLUDED__
#include "IGUIElement.h"
#include "ITexture.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
//! GUI element displaying an image.
class IGUIImage : public IGUIElement
{
protected:
bool alphablend;
video::SColor image_color;
public:
//! constructor
IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(environment, parent, id, rectangle)
{
image_color=video::SColor(255,255,255,255);
alphablend=false;
}
//! destructor
~IGUIImage() {};
//! sets an image
virtual void setImage(video::ITexture* image) = 0;
// set alphablending for the gui image
virtual void setAlphaBlend(bool enable)
{
alphablend=enable;
}
// set color for the gui image
virtual void setColor(const video::SColor& c)
{
image_color=c;
}
};
} // end namespace gui
} // end namespace irr
#endif
--------------------------------------------------------------------------------
CGUIImage.cpp
Code: Select all
//! draws the element and its children
void CGUIImage::draw()
{
if (!IsVisible)
return;
IGUISkin* skin = Environment->getSkin();
irr::video::IVideoDriver* driver = Environment->getVideoDriver();
core::rect<s32> rect = AbsoluteRect;
if (Texture)
{
driver->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner,
core::rect<s32>(core::position2d<s32>(0,0), Texture->getOriginalSize()),
&AbsoluteClippingRect, image_color,alphablend);
}
else
{
// maybe this would also be a good idea then
// driver->draw2DRectangle(image_color, AbsoluteRect, &AbsoluteClippingRect);
driver->draw2DRectangle(skin->getColor(EGDC_3D_DARK_SHADOW), AbsoluteRect, &AbsoluteClippingRect);
}
IGUIElement::draw();
}