# Plutonium framework API: pu::ui::extras::Toast Class Reference

pu::ui::extras::Toast Class Referencefinal

`#include <extras_Toast.hpp>`

Inheritance diagram for pu::ui::extras::Toast:

## Public Member Functions

| Toast (const std::string &text, const std::string &font_name, const Color text_clr, const Color bg_clr)
void | SetText (const std::string &text)
void | OnPreRender (render::Renderer::Ref &drawer) override
void | OnPostRender (render::Renderer::Ref &drawer) override
Public Member Functions inherited from pu::ui::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)
void | SetRadius (const i32 radius)
i32 | GetRadius ()
virtual void | OnPreRender (render::Renderer::Ref &drawer)
virtual void | OnPostRender (render::Renderer::Ref &drawer)
bool | Render (render::Renderer::Ref &drawer)
void | NotifyEnding (const bool ending)
Public Member Functions inherited from pu::ui::Container
| Container (const i32 x, const i32 y, const i32 width, const i32 height)
void | Add (elm::Element::Ref elem)
elm::Element::Ref & | At (const i32 idx)
bool | Has (elm::Element::Ref &elem)
void | Clear ()
size_t | GetCount ()
void | SetX (const i32 x)
i32 | GetX ()
void | SetY (const i32 y)
i32 | GetY ()
void | SetWidth (const i32 width)
i32 | GetWidth ()
void | SetHeight (const i32 height)
i32 | GetHeight ()
void | PreRender ()

## Static Public Attributes

static constexpr i32 | DefaultY = 550
static constexpr i32 | HeightAndTextHeightFactor = 3
static constexpr i32 | HorizontalMargin = 50
static constexpr u8 | BaseAlpha = 200
Static Public Attributes inherited from pu::ui::Overlay
static constexpr i32 | DefaultRadius = 25
static constexpr i32 | MaxFadeAlpha = 200
static constexpr i32 | FadeAlphaVariation = 25

## Additional Inherited Members

Protected Attributes inherited from pu::ui::Container
i32 | x
i32 | y
i32 | w
i32 | h
std::vector< elm::Element::Ref > | elems

## Constructor & Destructor Documentation

## Toast()

pu::ui::extras::Toast::Toast | ( | const std::string & | text,
|  | const std::string & | font_name,
|  | const Color | text_clr,
|  | const Color | bg_clr
| ) |  |

## Member Function Documentation

## OnPostRender()

void pu::ui::extras::Toast::OnPostRender | ( | render::Renderer::Ref & | drawer | ) |

overridevirtual

Reimplemented from pu::ui::Overlay.

## OnPreRender()

void pu::ui::extras::Toast::OnPreRender | ( | render::Renderer::Ref & | drawer | ) |

overridevirtual

Reimplemented from pu::ui::Overlay.

## SetText()

void pu::ui::extras::Toast::SetText | ( | const std::string & | text | ) |

## Member Data Documentation

## BaseAlpha

constexpr u8 pu::ui::extras::Toast::BaseAlpha = 200

staticconstexpr

## DefaultY

constexpr i32 pu::ui::extras::Toast::DefaultY = 550

staticconstexpr

## HeightAndTextHeightFactor

constexpr i32 pu::ui::extras::Toast::HeightAndTextHeightFactor = 3

staticconstexpr

## HorizontalMargin

constexpr i32 pu::ui::extras::Toast::HorizontalMargin = 50

staticconstexpr

The documentation for this class was generated from the following file:

- Plutonium/include/pu/ui/extras/extras_Toast.hpp