Hi,
i have used this code to make my tab control transparent :
for (irr::s32 i=0; i < irr::gui::EGDC_COUNT; ++i)
{
irr::video::SColor col = this->skin->getColor((irr::gui::EGUI_DEFAULT_COLOR)i);
col.set(0, 0, 0, 0);
this->skin->setColor((irr::gui::EGUI_DEFAULT_COLOR)i, col);
}
but checkboxes are also transparent how i can do ?
EDIT 1:
Or it is possible to make custom checkbox with a texture for exemple ?
Thanks for reply.
transparent TabControl
Re: transparent TabControl
Are you only trying to display the tabs of a tab control with a transparent color, but not all the other GUI controls?
Have you tried :
Have you tried :
Code: Select all
for(int i = 0; i < TabControl->getTabcount()-1; i++)
{
TabControl->getTab(i)->setBackgroundColor(irr::video::SColor(0,0,0,0));
}
-
- Posts: 2
- Joined: Mon May 29, 2017 7:49 pm
Re: transparent TabControl
yes i have tried but with no result :
There remains an apparent border
https://www.noelshack.com/2017-22-1496132881-menu.png
There remains an apparent border
https://www.noelshack.com/2017-22-1496132881-menu.png
Re: transparent TabControl
Hm, there are some more options to disable background drawing in Irrlicht svn trunk (aka what will be Irrlicht 1.9), but it seems I forgot IGUITabControl (added features for IGUITab and IGUICheckBox, but not this one yet...).
But try only setting EGDC_3D_HIGH_LIGHT and EGDC_3D_DARK_SHADOW instead of all skin-colors. Those seem to be used by tab-control but not by checkbox as far as I can see on a quick check.
Otherwise your easiest option is probably to copy the code of CGUITabControl.cpp/.h, rename the class and then use your own modified tab-control where you kick out the lines which do the background drawing.
But try only setting EGDC_3D_HIGH_LIGHT and EGDC_3D_DARK_SHADOW instead of all skin-colors. Those seem to be used by tab-control but not by checkbox as far as I can see on a quick check.
Otherwise your easiest option is probably to copy the code of CGUITabControl.cpp/.h, rename the class and then use your own modified tab-control where you kick out the lines which do the background drawing.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: transparent TabControl
Hum. I thought that was weird, but then I looked at the code and it made sense.
Technically, this prevents each tab from being drawn :
But that tab control itself is drawing something on the screen, and there's no exposed property/method to affect this.
I'd recommend, as CuteAlien said, to reimplement the tab control's drawing. I'm not sure you need to copy the entire class, though. You could simply derive a class from CGUITabControl, and override the draw() method. Copy the draw() method, and get rid of all the drawing that happens inside. Okay, I suck at inheritance. This won't work (see below). Do exactly as CuteAlien said.
Technically, this prevents each tab from being drawn :
Code: Select all
for(int i = 0; i < TabControl->getTabcount()-1; i++)
{
IGUITab * currentTab = TabControl->getTab(i);
currentTab->setBackgroundColor(irr::video::SColor(0,0,0,0));
currentTab->setDrawBackground(false);
}
I'd recommend, as CuteAlien said, to reimplement the tab control's drawing. I'm not sure you need to copy the entire class, though. You could simply derive a class from CGUITabControl, and override the draw() method. Copy the draw() method, and get rid of all the drawing that happens inside. Okay, I suck at inheritance. This won't work (see below). Do exactly as CuteAlien said.
Last edited by MartinVee on Tue May 30, 2017 5:34 pm, edited 1 time in total.
Re: transparent TabControl
You can't derive from implementation classes - only from interfaces. But copy-paste works well in this case :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: transparent TabControl
Ah, yes, you're right, of course, silly me. I've been working with C for the last 10 years, so I'm still a bit rusted on inheritance.
Re: transparent TabControl
Just checked it some more. When you create a new tab-control you can pass 2 parameters to addTabControl: fillbackground and border. The first is disabled by default, but the second isn't. So you can disable that one to get rid of some lines.
With svn-trunk version of Irrlicht you can also then additionally disable background drawing for each tab.
There seems to be one special case - when there are no tabs at all. In that case it draws some bright background as palceholder.
Also you can use your own skin and overload draw3DTabBody to change the drawing to the tab-area background (but no control over tab-button-bar).
With svn-trunk version of Irrlicht you can also then additionally disable background drawing for each tab.
There seems to be one special case - when there are no tabs at all. In that case it draws some bright background as palceholder.
Also you can use your own skin and overload draw3DTabBody to change the drawing to the tab-area background (but no control over tab-button-bar).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm