Game Development Community

GuiBitmapCtrl output brighter than GuiSpriteCtrl

by Jeffrey Parker · in Torque 2D Beginner · 04/15/2013 (8:52 pm) · 3 replies

I've been using the GuiSpriteCtrl in menus, and noticed that images seem to be rendered darker than they should be. As a test, rendering an image containing a pure white block in the GuiSpriteCtrl and GuiBitmapCtrl side by side, the difference is immediately noticeable. A screenshot revealed that the bitmap control produces the right colour, but the sprite control instead produces #d3d3d3. I've unscientifically ruled out an opacity problem in my test by putting a noise texture behind both, but the blocks remained smooth.

Does anyone have any insights as to why this might be happening?

#1
04/15/2013 (9:04 pm)
Scrap this, I did a script search for "211 211 211" (d3d3d3) and found the fill colour in the default GUI profile, changed it to "255 255 255", and voila. I didn't realise that GuiSpriteCtrl used the GUI profile fill colour as a modifier when rendering sprites. I should maybe ask if this is intentional and suggest it go in the docs (assuming it isn't there already and I didn't just miss it).
#2
04/16/2013 (4:39 am)
It is intentional and it should be added to the documentation if it's not already there. We need a full writeup on the GUI system in general.
#3
04/16/2013 (11:15 am)
@Jeffrey it's intentional as you can use the fill color of your GUI profile as a blend color against the image. This allows you to have different colored GUI elements from the same source bitmap.