GUI and text problem.

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
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

GUI and text problem.

Post by deps »

Hello,

Just started to use the iirlicht engine.
I'm trying to add some text in my little game.
Here is what i do:

Code: Select all

driver->draw2DRectangle(SColor(128,128,128,255),rect<s32>(0, 0, screen_w, 30));			
			
swprintf(fpsbuf, 128, L"%d fps @ %d triangles", fps, driver->getPrimitiveCountDrawn());
gamefont->draw(fpsbuf, rect<s32>(5,5,screen_w-5,15), SColor(255,255,255,255));
As far as i can tell, this early in my irrlicht experience, white non-transparent text on lightblue (or something like that) 50% transparent filled rectangle.

But in my game i get black text on black 50% transparent rectangle.

I have looked in the tutorials, in the API documentation and have searched the forum. but cant find any help or solution.

I used the IrrFontTool from 0.4.0 to convert a Arial font, and it is in 24bpp.

Using Irrlicht 0.4.2 and OpenGL.
compiling with mingw.

Thankful for any help.
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Wee. Tried to draw everything without any transparency.

Code: Select all

driver->draw2DRectangle(SColor(255,0,0,255),rect<s32>(0, 0, screen_w, 30));			
swprintf(fpsbuf, 128, L"%d fps @ %d triangles", fps, driver->getPrimitiveCountDrawn());
gamefont->draw(fpsbuf, rect<s32>(5,5,screen_w-5,15), SColor(255,255,255,255));
And in fullscreen with 32bpp. Now i got a rectangle that is not quite blue, and some text not exactly white.
edit: (Still not working, btw)
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

I added a small mesh to my scene. From a milkshape3d model.
And the text i'm trying to draw get's drawn correctly if i look at the ms3d model.

edit: and before i only had a Quake3 bsp.
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

If you don't want the GUI to be transparent. You've got to adjust the alpha. . .

Code: Select all

s32 boo = 255;
for (s32 i=0; i<EGDC_COUNT ; ++i)
{
SColor col = Guienv->getSkin()->getColor((EGUI_DEFAULT_COLOR)i);
col.setAlpha(boo);
Guienv->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col);
}
And just fix the colors yourself. . . (that will only effect the alpha).
Programmer of the Irrlicht Scene Editor:
Homepage - Forum Thread
Version 2 on its way!!
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

But even if i'm not using any alpha or transparency, the colors are still wrong.
I have to look at a mesh for them to show up like they should.

If i load a Q3 map the rectangle and the text got wrong colors.
But if i also load another mesh, and look at it, the colors are ok.
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

deps wrote:But even if i'm not using any alpha or transparency, the colors are still wrong.
I have to look at a mesh for them to show up like they should.

If i load a Q3 map the rectangle and the text got wrong colors.
But if i also load another mesh, and look at it, the colors are ok.
read this thread.. there appears to be some problems with 0.4.2 and 32bit alpha http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=517
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Looks like i have to hack the irrlicht source. i was hoping to avoid that.
Ok. thanks a lot.
Post Reply