Bug in API documentation maybe...

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Bug in API documentation maybe...

Post by Endar »

Okay, I've been looking at the documentation for SColor::setAlpha() and I think that there may be a mistake in the docs.
void irr::video::SColor::setAlpha( s32 a ) [inline]

Sets the alpha comonent of the Color. The alpha component defines how transparent a color should be.

Parameters:
a: Has to be a value between 0 and 255. 0 means not transparent, 255 means fully transparent.
http://irrlicht.sourceforge.net/docu/cl ... or.html#a7

and I've been using this line of code: video::SColor bar_color = video::SColor(255,0,0,0) and when the code is as shown, the rectangle I'm drawing comes up. But when I replace the alpha value of 255 with 0, the I can't see the rectangle.

So, is the setAlpha function a bit different from when I create a color with SColor() or is this a mistake??
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
VPB
Posts: 36
Joined: Sat Apr 10, 2004 8:02 am

Post by VPB »

I alway thought that alpha 0 means fully transparent and
255 not transparent.

Try the value 255 instead of 0 8)

I could be wrong :!: :!: :!:
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

Yeah, I know. When I put 255, I can see the rectangle, and when I put 0, I can't see it. Ergo: 255 means solid and 0 means transparent.

So, thats why I was a little confused because the API docs for SColor::setAlpha() has it the other way around.
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
Post Reply