Major Screen changes. (If using the screen class, read the description!!)

Changes which are needed when using the screen class:

- Add `void callConstructor() override { }` to your screen's public header.
- Call `Gui::DrawScreen();` to draw the screen.
- Call `Gui::ScreenLogic(u32 hDown, u32 hHeld, touchPosition touch);` to call the Logic.
- Call `Gui::CallConstructor();` to call the used screen's constructor.
- call `Gui::setScreen(std::make_unique<ScreenName>(), <true/ false, depends if you like to transfer the screen to the usedScreen directly.>);` to set the screen.
- Call `Gui::transferScreen();` in case you like to set the tempScreen to the used one.
- Get rid of the `Gui::screenBack();` calls and use `Gui::setScreen(...)` directly for it.
This commit is contained in:
StackZ
2020-05-26 05:25:33 +02:00
parent f0dca7c784
commit a5f7134d1c
6 changed files with 55 additions and 31 deletions
+2 -3
View File
@@ -30,13 +30,12 @@
#include <3ds.h>
#include <memory>
class Screen
{
class Screen {
public:
virtual ~Screen() {}
virtual void Logic(u32 hDown, u32 hHeld, touchPosition touch) = 0;
virtual void Draw() const = 0;
private:
virtual void callConstructor() = 0;
};
#endif