Code: Select all
// create a button
gui::IGUIButton *b1 = _gui->addButton(core::rect<s32>(0,0,128,128));
//remove the border of the button.
b1->setDrawBorder(false);
// set the image
b1->setImage(device->getVideoDriver()->getTexture("../../media/button1.png"));
// use the alpha channel so we get no background
b1->setUseAlphaChannel(true);
Code: Select all
// loop through all items and set alpha to 150
for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
{
video::SColor col = _gui->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
col.setAlpha(150);
_gui->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
}
Screenshot:
Left is a button with an image on it and right is a plain button. Both have the _gui->getSkin()->setColor(...) applied to them with a 100 alpha. The left has no change and the right is see through.