mirror of
https://github.com/DarkStore-3DS/Universal-Core.git
synced 2026-07-04 16:59:04 +00:00
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:
@@ -32,10 +32,8 @@
|
||||
#include <3ds.h>
|
||||
#include <citro2d.h>
|
||||
#include <citro3d.h>
|
||||
#include <stack>
|
||||
|
||||
namespace Gui
|
||||
{
|
||||
namespace Gui {
|
||||
// Clear the Text Buffer.
|
||||
void clearTextBufs(void);
|
||||
|
||||
@@ -134,20 +132,31 @@ namespace Gui
|
||||
*/
|
||||
bool Draw_Rect(float x, float y, float w, float h, u32 color);
|
||||
|
||||
/* Used for the mainLoop to display the screens. (Optional!)
|
||||
// Used for the current Screen's Draw. (Optional!)
|
||||
void DrawScreen();
|
||||
|
||||
/* Used for the current Screen's Logic. (Optional!)
|
||||
* hDown: the hidKeysDown() variable.
|
||||
* hHeld: the HidKeysHeld() variable.
|
||||
* touch: The TouchPosition variable.
|
||||
*/
|
||||
void mainLoop(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
void ScreenLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
|
||||
/* Set a specific Screen.
|
||||
* screen: unique_ptr of the screen. (Optional by using the screen class.)
|
||||
/* Used for the current Screen's Constructor call. (Optional!)
|
||||
* This is useful if you need to call the screen's constructor.
|
||||
*/
|
||||
void setScreen(std::unique_ptr<Screen> screen);
|
||||
void CallConstructor();
|
||||
|
||||
/* Transfer the Temp Screen to the used one. (Optional!)
|
||||
* It will check, if the tempScreen variable is not nullptr, so don't worry.
|
||||
*/
|
||||
void transferScreen();
|
||||
|
||||
// Go a Screen back. (Optional by using the screen class.)
|
||||
void screenBack();
|
||||
/* Set a specific Screen with switch function. (Optional!)
|
||||
* screen: unique_ptr of the screen. (Optional by using the screen class.)
|
||||
* screenSwitch: Wheter to switch to the current screen.
|
||||
*/
|
||||
void setScreen(std::unique_ptr<Screen> screen, bool screenSwitch = true);
|
||||
|
||||
/* Set on which screen to draw.
|
||||
* screen: The render target. (Targets are inside the screenCommon.hpp file.)
|
||||
|
||||
Reference in New Issue
Block a user