Request: SplashScreen::showMessage()


Hi, Jules

Do you have time to add this method in SplanshScreen?

/** ... */
enum { topLeft = 0, topRight, centred, bottomLeft, bottomRight};

/** ... */
void showMessage(const String& message,
                 int placement = 3,
                 float foneSize = 18.0f,
                 const Colour& fontColour = Colours::black);

/** ... */
void showMessage(const String& message,
                 Rectangle<int> placement,
                 float foneSize = 18.0f,
                 const Colour& fontColour = Colours::black);


SplashScreen* splash = new SplashScreen();

splash->show ("welcome to my app",
               ImageCache::getFromFile (File ("/foobar/splash.jpg")),
               4000, false);

splash->showMessage("init A...");

splash->showMessage("init B...");

// ...


I’m not sure that the splashscreen class should do that… There are so many different ways that people might want to draw text over it that I think it’s probably better for people to create their own subclass and draw the text however they want.


This actually sounds useful, and something I might use at least temporarily if not permanently. I agree with Jules, its a bit specific to put in a general purpose splash screen class. On the other hand, if you would like to write a subclass that does this yourself, you could wrap it up in a small demo application and contribute it to AppletJUCE:

AppletJUCE! on Github.


BTW I’d recommend using an AttributedString rather than dealing with the font, colour, layout, etc directly.


Okay. thanks.