# Plutonium framework API: Plutonium/include/pu/ui/ui_Overlay.hpp Source File

ui_Overlay.hpp
Go to the documentation of this file.
/*
Plutonium library
@file ui_Overlay.hpp
@brief An overlay is some kind of "pop-up", like notification messages or similar items
@author XorTroll
@copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
*/
#pragma once
#include <pu/ui/ui_Container.hpp>
namespace pu::ui {
class Overlay : public Container {
public:
static constexpr i32 DefaultRadius = 25;
static constexpr i32 MaxFadeAlpha = 200;
static constexpr i32 FadeAlphaVariation = 25;
private:
i32 fade_a;
Color bg_clr;
i32 rad;
bool is_ending;
bool round;
public:
Overlay(const i32 x, const i32 y, const i32 width, const i32 height, const Color bg_clr, const bool round = true, const i32 radius = DefaultRadius) : Container(x, y, width, height), fade_a(0), bg_clr(bg_clr), rad(radius), is_ending(false), round(round) {}
PU_SMART_CTOR(Overlay)
inline void SetRadius(const i32 radius) {
this->rad = radius;
}
inline i32 GetRadius() {
return this->rad;
}
virtual void OnPreRender(render::Renderer::Ref &drawer) {}
virtual void OnPostRender(render::Renderer::Ref &drawer) {}
bool Render(render::Renderer::Ref &drawer);
inline void NotifyEnding(const bool ending) {
this->is_ending = ending;
}
};
}
pu::ui::Container
Definition: ui_Container.hpp:21
pu::ui::Container::x
i32 x
Definition: ui_Container.hpp:23
pu::ui::Container::y
i32 y
Definition: ui_Container.hpp:24
pu::ui::Overlay
Definition: ui_Overlay.hpp:19
pu::ui::Overlay::NotifyEnding
void NotifyEnding(const bool ending)
Definition: ui_Overlay.hpp:48
pu::ui::Overlay::FadeAlphaVariation
static constexpr i32 FadeAlphaVariation
Definition: ui_Overlay.hpp:23
pu::ui::Overlay::OnPostRender
virtual void OnPostRender(render::Renderer::Ref &drawer)
Definition: ui_Overlay.hpp:45
pu::ui::Overlay::Render
bool Render(render::Renderer::Ref &drawer)
pu::ui::Overlay::DefaultRadius
static constexpr i32 DefaultRadius
Definition: ui_Overlay.hpp:21
pu::ui::Overlay::MaxFadeAlpha
static constexpr i32 MaxFadeAlpha
Definition: ui_Overlay.hpp:22
pu::ui::Overlay::OnPreRender
virtual void OnPreRender(render::Renderer::Ref &drawer)
Definition: ui_Overlay.hpp:44
pu::ui::Overlay::SetRadius
void SetRadius(const i32 radius)
Definition: ui_Overlay.hpp:36
pu::ui::Overlay::Overlay
Overlay(const i32 x, const i32 y, const i32 width, const i32 height, const Color bg_clr, const bool round=true, const i32 radius=DefaultRadius)
Definition: ui_Overlay.hpp:33
pu::ui::Overlay::GetRadius
i32 GetRadius()
Definition: ui_Overlay.hpp:40
pu::ui
Definition: elm_Button.hpp:18
pu::i32
s32 i32
Definition: pu_Include.hpp:28
PU_SMART_CTOR
#define PU_SMART_CTOR(type)
Definition: pu_Include.hpp:19
pu::ui::Color
Definition: ui_Types.hpp:44
ui_Container.hpp