GuiFadeinBitmapCtrl only fades in the first image
by Jinnie Ong · in Torque 3D Professional · 01/31/2010 (11:36 pm) · 5 replies
There hasn't been any posts on this (not that I can find), so I'm not sure if it's an actual bug, or I'm just using this control wrong.
What I'm trying to do is to have a slideshow of sorts, so one image will fade in, and after the user has read a few lines of dialogue, it'll fade out, and the next image will fade in.
To do this, I created a bunch of GuiFadeinBitmapCtrls, with all of them set to invisible and Done = 0 at the start. When it's the image's turn to show up, I set it to visible.
Thing is, only the first image fades in, the rest simply just pop up directly after the fadeInTime is over. Anyone have suggestions on how to go about making a slideshow-ish introduction? Thanks!
What I'm trying to do is to have a slideshow of sorts, so one image will fade in, and after the user has read a few lines of dialogue, it'll fade out, and the next image will fade in.
To do this, I created a bunch of GuiFadeinBitmapCtrls, with all of them set to invisible and Done = 0 at the start. When it's the image's turn to show up, I set it to visible.
Thing is, only the first image fades in, the rest simply just pop up directly after the fadeInTime is over. Anyone have suggestions on how to go about making a slideshow-ish introduction? Thanks!
#2
Ok, changed this in head to starting counting from the first call to onRender() rather than from onWake(). This should also make an approach like you have implemented above (toggling visibility) possible.
Additionally, I've added customizable easing curves to fade-in and fade-out since linear interpolation rarely makes for nice animation.
02/01/2010 (6:42 am)
Ok, changed this in head to starting counting from the first call to onRender() rather than from onWake(). This should also make an approach like you have implemented above (toggling visibility) possible.
Additionally, I've added customizable easing curves to fade-in and fade-out since linear interpolation rarely makes for nice animation.
#4
02/10/2010 (9:53 pm)
This is a little late, but thank you. :) Looking forward to the next release!
#5
As far as I am aware, the changes are not in the current first beta (you have to stop rolling in changes at some point to get a stable build) but will definitely be in the next.
02/11/2010 (4:20 am)
As far as I am aware, the changes are not in the current first beta (you have to stop rolling in changes at some point to get a stable build) but will definitely be in the next.
Associate Rene Damm
The counter for GuiFadeinBitmapCtrl starts when the control is added to the canvas and is not keyed to visibility. So, by the time you are making the controls visible, all their counters have already expired.
Thus, to have a number of sequential fade controls, these need to be put into a wake-up sequence, i.e. once a given bitmap has faded out, it needs to wake up the next control in the sequence.
That said, I'm not quite so happy with how GuiFadeinBitmapCtrl is doing this and think I'll change it thus that it is counting from the first render rather from onWake() (or at least add this as an alternate codepath). The problem with onWake() is that it may take an indefinite amount of time for the control to actually display which is especially noticeable with the fade-bitmaps used during engine startup. When the engine comes up slow, these will not fade properly.