// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Types/DateTime.h"
#include "Engine/Platform/Window.h"
class Asset;
class Font;
///
/// Splash Screen popup
///
class SplashScreen
{
private:
Window* _window = nullptr;
Font* _titleFont = nullptr;
Font* _subtitleFont = nullptr;
String _title;
DateTime _startTime;
String _infoText;
float _dpiScale, _width, _height;
StringView _quote;
public:
///
/// Finalizes an instance of the class.
///
~SplashScreen();
public:
///
/// Sets the title text.
///
/// The title text.
void SetTitle(const String& title)
{
_title = title;
}
///
/// Gets the title text.
///
/// Title text.
FORCE_INLINE const String& GetTitle() const
{
return _title;
}
///
/// Determines whether this popup is visible.
///
/// True if this popup is visible, otherwise false
FORCE_INLINE bool IsVisible() const
{
return _window != nullptr;
}
public:
///
/// Shows popup.
///
void Show();
///
/// Closes popup.
///
void Close();
private:
void OnShown();
void OnDraw();
bool HasLoadedFonts() const;
void OnFontLoaded(Asset* asset);
};