Hi,
I just made my own GUI skin and I'd like to make the checkbox tick white now - is there a possibility to do that? Has anyone got some example code?
Thanks in advance!
How to make the checkbox tick white?
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
Re: How to make the checkbox tick white?
Untested, but something like this should work.
http://irrlicht.sourceforge.net/docu/namespaceirr_1_1gui.html#abd15860fde29833c48daff5f95d5467a
Code: Select all
skin->setColor(EGDC_ICON_HIGH_LIGHT, video::SColor(255, 255, 255, 255));
"Whoops..."
Code: Select all
//! draws the element and its children
void CGUICheckBox::draw()
{
if (!IsVisible)
return;
IGUISkin* skin = Environment->getSkin();
core::rect<s32> rect = AbsoluteRect;
s32 height = skin->getSize(EGDS_CHECK_BOX_WIDTH);
core::rect<s32> checkRect(AbsoluteRect.UpperLeftCorner.X,
((AbsoluteRect.getHeight() - height) / 2) + AbsoluteRect.UpperLeftCorner.Y,
0, 0);
checkRect.LowerRightCorner.X = checkRect.UpperLeftCorner.X + height;
checkRect.LowerRightCorner.Y = checkRect.UpperLeftCorner.Y + height;
skin->draw3DSunkenPane(this, skin->getColor(Pressed || !IsEnabled ? EGDC_3D_FACE : EGDC_ACTIVE_CAPTION),
false, true, checkRect, &AbsoluteClippingRect);
if (Checked && Environment->getSkin())
Environment->getSkin()->drawIcon(this, EGDI_CHECK_BOX_CHECKED, checkRect.getCenter(),
checkTime, os::Timer::getTime(), false, &AbsoluteClippingRect);
if (Text.size())
{
checkRect = AbsoluteRect;
checkRect.UpperLeftCorner.X += height + 5;
IGUIFont* font = skin->getFont();
if (font)
font->draw(Text.c_str(), checkRect,
skin->getColor(EGDC_BUTTON_TEXT), false, true, &AbsoluteClippingRect);
}
IGUIElement::draw();
}
if (Checked && Environment->getSkin())
Environment->getSkin()->drawIcon(this, EGDI_CHECK_BOX_CHECKED, checkRect.getCenter(),
checkTime, os::Timer::getTime(), false, &AbsoluteClippingRect);