Add GUI reinit

This commit is contained in:
RocketRobz
2020-06-30 23:51:31 -06:00
parent d0d78f2bfb
commit 9899de0428
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -105,6 +105,15 @@ void Gui::exit(void) {
if (usedScreen != nullptr) usedScreen = nullptr;
}
// Reinitialize GUI.
Result Gui::reinit(void) {
C2D_TextBufDelete(TextBuf);
C2D_Fini();
C3D_Fini();
return init();
}
// Draw a Centered String.
void Gui::DrawStringCentered(float x, float y, float size, u32 color, std::string Text, int maxWidth, int maxHeight, C2D_Font fnt) {
float lineHeight, widthScale;
+3
View File
@@ -76,6 +76,9 @@ namespace Gui {
// Exit the GUI. (Call this at exit.)
void exit(void);
// Reinit the GUI.
Result reinit(void);
/* Draws a centered String.
* x: The X Offset from center. (Center: 200 px on top, 160 px on Bottom.)
* y: The Y Position of the Text.