transperant window? (solved)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

transperant window? (solved)

Post by MikeR »

http://gallery.3dcentral.net/screenshots/transperant

Code: Select all

void showSavedText()
{
   device->getGUIEnvironment()->addMessageBox (Caption.c_str(), SavedText.c_str());

Code: Select all

class MyEventReceiver : public IEventReceiver
{
public:
	virtual bool OnEvent(SEvent event)
	{
		if (event.EventType == EET_GUI_EVENT)
		{
			s32 id = event.GUIEvent.Caller->getID();
			IGUIEnvironment* env = device->getGUIEnvironment();

			switch(event.GUIEvent.EventType)
			{

Code: Select all

case EGET_MENU_ITEM_SELECTED:
     {
                             //a menu item was clicked
     IGUIContextMenu* menu = (IGUIContextMenu*)event.GUIEvent.Caller;
     s32 id = menu->getItemCommandId(menu->getSelectedItem());
     switch(id)
     {
There is nothing there to make the window transperant that I can find.
How do I make it solid? It's kinda hard to read this way.
Last edited by MikeR on Tue Aug 30, 2005 12:57 am, edited 1 time in total.
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
FlyHigh
Posts: 111
Joined: Wed Mar 23, 2005 12:05 am

Post by FlyHigh »

Are you using your own skin for the elements?

if you are than check all the SColors are properly initialized... 0xFF00000 looks like solid blacks but will apear as almost transparent red just by missing off the 0. (grrr... its happened to me too many times :()

if not I recommend checking the default one's defaults colors while its being drawn, some of my IGUIButtons come out slightly transparent as well so its probably a default thing.
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

My code for the windows is the default code. I'm figureing there is something missing, I just don't know what.
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Please take a look at irrlicht-0.12.0\examples\05.UserInterface
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

Tutorial #5 is the base of what I'm using. What happened is that I forgot about the slider to make the gui transperant.

Code: Select all

case EGET_SCROLL_BAR_CHANGED:	if (id == 104)	{		s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();							for (s32 i=0; i<EGDC_COUNT ; ++i)		{			SColor col = env->getSkin()->getColor((EGUI_DEFAULT_COLOR)i);			col.setAlpha(pos);			env->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col);		}	}break;

I removed the actual slider code, but forgot about the above. My problem is..even without all the code for the transperant slider, I'm still 50% transparent.
I will most likely (and am going to try next) is to add: env->getSkin()->setColor((0,122,65,171) to see if that fixes my problem.

Edit to add:

Duhh, the meshviewer tut had the answer.

Code: Select all

// disable alpha	for (s32 i=0; i<gui::EGDC_COUNT ; ++i)	{		video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);		col.setAlpha(255);		env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);	}
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
Post Reply