fadeOut Component question


#1

Juce Friends,

I’ve found the fadeOut component call to look quite compelling but I don’t know how to use it when you change between components. Here is my code below. The problem is that when I have the setContentComponent enabled, the new component immediately appears and the old one does not fade out. Is there a way to have the component fade out and after the visually stunning fade out, then the new component is set to the DocumentWindow object via the setContentComponent call?

if (result == 1) {
// Try to fade out the current AuthComponent but the fade out effect isn’t working when the setContentComponent is running
fadeOutComponent(1000);

            MainMenuComponent* themenu;
            themenu = new MainMenuComponent();
            addAndMakeVisible(themenu);

            theMainWindow->setName(T("Welcome to LAVA"));
            theMainWindow->setContentComponent(themenu);
            theMainWindow->setFullScreen(true);

} else {


#2

There’s no way to do that automatically - the whole point of the fade out component is that it doesn’t block the message thread, it just fades out while your code gets on with it.

One of the things that I’m planning to be able to do with my new graphics code is to give components an opacity, so you could easily animate things like this with a timer, but am not quite there yet…


#3

Thanks Jules. I’ll look forward to the new code and being able to play with those new animations.


#4