Game Development Community

Masking GUI elements.

by AllynMcelrath · in Torque Game Engine · 10/29/2007 (10:41 am) · 7 replies

I have a GUI control thats just a bitmap, however, when it moves to the left, i want/need it to pass under a Mask of some sort and (using the mask) fade to nothing (then toggle visibility).

How can i go about using Masks for GUI elements? Is it even possible in TGE? I can't find any reference to this anywhere.

Another example, would be using a mask to take the CommanderHUD (That is square), and make it round(By masking off the areas not used).

#1
10/30/2007 (11:16 am)
I am assuming there is no way to do this, i have looked and looked and found no reference...If any one has any ideas, i still watch this thread.
#2
10/30/2007 (11:50 am)
I think this would take a fair bit of work to implement, but would certainly be cool.

on second thought,
i bet TGB can do this,
and i hear that it's comparatively easy to integrate TGB onto TGE.
#3
10/30/2007 (12:40 pm)
I am sure both options are beyond my ability's. Ill take a look, or i will find a creative solution.

Thanks for the reply.
#4
10/31/2007 (7:00 am)
It used to be much easier to implement TGB into TGE. But as the products have matured in different directions, it is much more difficult now.
#5
10/31/2007 (7:05 am)
Hey guys. Just wanted to clarify something..
While Orion partly correct, the "TGB" approach is not right.
Yes, it's comparatively easy to integrate TGB onto TGE (TGB1.0.x not the TGB1.5.x), but "GUI" part of TGB is the same as in TGE (!!!).

The TGB is only about 2D, it's not "enhanced guis", it's about "sprites", it's own scenegraph, etc.

Edit: But of course you can build your "UI" in 2D, but that is huge amount of work to be done, much more than using Torque GUI routine.
#6
09/04/2009 (10:26 am)
Did anyone make any ever make any progress with this?
#7
09/04/2009 (1:35 pm)
i used a trick to achieve a limited version of this, which only works in restricted situations. i had a static background, and i wanted some text to scroll over it, with the text fading in at the bottom and fading out at the top. so i took a screenshot of the static background and photo-shopped it so the top and bottom remained opaque but faded to 100% transparent at the middle. i then made a GuiBitmapCtrl with that image and put it over the GuiMLTextCtrl. it worked great. if you still have a copy of vSide you can see the effect by clicking "credits" on the opening screen. the final gui arrangement looked like this:

GuiBitmapCtrl       800x600 - the static background
   GuiControl       100x300 - used to contain and clip the text
      GuiMLTextCtrl 100x300
      GuiBitmapCtrl 100x300 - "mask"