Is GuiFadeinBitmapCtrl Resizeable?
by Gina-Marie -Netjera- Hammer · in Torque Game Builder · 09/26/2006 (11:23 am) · 14 replies
I have the following code set up in my GUI file:
//--- OBJECT WRITE BEGIN ---
new GuiFadeinBitmapCtrl(FirstBubble) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "382 47";
Extent = "125 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "~/data/images/Greetings";
wrap = "0";
fadeinTime = "2000";
waitTime = "5000";
fadeoutTime = "2000";
done = "1";
};
//--- OBJECT WRITE END ---
Notice both the position and extent are set smaller than full-screen.
If I run the game, the gui comes up full screen. If I open this gui in the editor, position and extent are showing as full screen. If I change the editor values to match these, I can see the gui resize within the editor. I accept the changes, save and exit the gui editor. I run the level and the gui is full size again.
Is this a bug, or am I doing something horribly wrong? Why would the script values be correct, but being overidden by the editor values (which are seemingly unchanbeable)?
//--- OBJECT WRITE BEGIN ---
new GuiFadeinBitmapCtrl(FirstBubble) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "382 47";
Extent = "125 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "~/data/images/Greetings";
wrap = "0";
fadeinTime = "2000";
waitTime = "5000";
fadeoutTime = "2000";
done = "1";
};
//--- OBJECT WRITE END ---
Notice both the position and extent are set smaller than full-screen.
If I run the game, the gui comes up full screen. If I open this gui in the editor, position and extent are showing as full screen. If I change the editor values to match these, I can see the gui resize within the editor. I accept the changes, save and exit the gui editor. I run the level and the gui is full size again.
Is this a bug, or am I doing something horribly wrong? Why would the script values be correct, but being overidden by the editor values (which are seemingly unchanbeable)?
About the author
Art, Games, Life www.netjera.com
#2
Thanks!
09/26/2006 (12:15 pm)
So how do I fix this? By making another object at full screen and then dropping the fade onto it? Will the fade still work in that respect? Also, how do I know which "outer" object will work with this particular control?Thanks!
#3
09/26/2006 (12:29 pm)
I believe you can nest any object inside any other object. Though for some good ideas try opening the gui editor and from the center dropdown take a look at how a few of the MessageBox dialogs are made. Use the same outer control they use.
#4
09/26/2006 (6:52 pm)
Thanks a lot! I really appreciate it. :)
#5
Anyone know if there's a way around this? I have a background graphic that I'd like to show through while the fade occurs.
Thanks again!
(PS - I checked the wiki and it doesn't appear to be addressed anywhere. :P )
09/26/2006 (10:33 pm)
It's working now, and resizing properly. The one thing I've noticed, though, is that the bitmap fades in from black, so that anything I have in the background winds up being wiped out by the black frame. I created the bitmap transparently, so this must be a function of the control.Anyone know if there's a way around this? I have a background graphic that I'd like to show through while the fade occurs.
Thanks again!
(PS - I checked the wiki and it doesn't appear to be addressed anywhere. :P )
#6
09/26/2006 (11:01 pm)
Fade out is different than a transition to full alpha blend. What you're talking about sounds more like a dissolve than a fade. Fading goes to black while the dissolve goes to whatever is "underneath" the thing that is dissolving. I don't have a suggestion right off on how to do the difference in TGB as I'm not sure if gui controls support alpha blend, but start checking there.
#7
09/26/2006 (11:23 pm)
Thanks! I really thought I'd found the answer, but if there's no way to change the fade to black, then I'll need to find another approach. :)
#9
Thanks Tom.
09/27/2006 (12:58 am)
*blinks* What is THIS? *reads frantically, not sure she's understanding*Thanks Tom.
#10
Note that i spent a grand total of about 30 seconds on it and didnt test it very well, so it may not be perfect. You also might have to put what you want to fade in a dialog then use Canvas.pushDialog() to show it.
T.
09/27/2006 (4:15 am)
Stick it in engine/gui/game/ (adjust path for new naming scheme) replacing the one that's there, rebuild TGB, then you can stick alphaFade = "1"; in the GUI to get it to alpha fade rather then the black thing.Note that i spent a grand total of about 30 seconds on it and didnt test it very well, so it may not be perfect. You also might have to put what you want to fade in a dialog then use Canvas.pushDialog() to show it.
T.
#11
If this works, it will be SO much better than my alternative (coding the transitions in functions). I can do it, but it's about a zillion more lines of code that way. ^.^
09/27/2006 (4:17 am)
I'll hink around and see if I can get it to work. You're the best! Thanks!If this works, it will be SO much better than my alternative (coding the transitions in functions). I can do it, but it's about a zillion more lines of code that way. ^.^
#12
void onRender(Point2I offset, const RectI &updateRect)
{
if(! alphaFade)
...
is everything from there to the else you added supposed to be part of the if? Or just the first line that goes:
Parent::onRender(offset, updateRect); ?
(There are no braces after the if.)
09/27/2006 (4:25 am)
I was examining what you did and comparing it to what was in the original. Where you have:void onRender(Point2I offset, const RectI &updateRect)
{
if(! alphaFade)
...
is everything from there to the else you added supposed to be part of the if? Or just the first line that goes:
Parent::onRender(offset, updateRect); ?
(There are no braces after the if.)
#13
09/27/2006 (8:46 am)
Nope, just the line. if alphaFade isnt set, it works the same as before. If it is set, it works the lazy hack way.
#14
*keeps plugging away at it*
Thanks!
09/27/2006 (3:01 pm)
Hmm I think I'm getting myself confused then. I can't seem to figure out which if goes with which else. grrr*keeps plugging away at it*
Thanks!
Torque Owner Ben R Vesco
The outer gui object is always stretched to full screen. The outer gui object essentially dictates what coordinate system the rest of the nested gui obejcts will adhere to. Open up some other guis and notice the root gui object is usually set to "640 480" and child objectcs are then positioned within that. This allows the gui to be resized and maintain positioning and extents based on the rules you configure. To restate, your outer gui will always be full screen.
Tag: TGB in GPGT