mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-06 00:38:59 +00:00
Add a Fade in Effect for Startup.
This commit is contained in:
@@ -45,6 +45,8 @@ touchPosition touch;
|
|||||||
sound *bgm = NULL;
|
sound *bgm = NULL;
|
||||||
bool songIsFound = false;
|
bool songIsFound = false;
|
||||||
|
|
||||||
|
int fadealpha = 255;
|
||||||
|
bool fadein = true;
|
||||||
|
|
||||||
// If button Position pressed -> Do something.
|
// If button Position pressed -> Do something.
|
||||||
bool touching(touchPosition touch, Structs::ButtonPos button) {
|
bool touching(touchPosition touch, Structs::ButtonPos button) {
|
||||||
@@ -120,6 +122,14 @@ int main()
|
|||||||
Gui::mainLoop(hDown, hHeld, touch);
|
Gui::mainLoop(hDown, hHeld, touch);
|
||||||
C3D_FrameEnd(0);
|
C3D_FrameEnd(0);
|
||||||
gspWaitForVBlank();
|
gspWaitForVBlank();
|
||||||
|
|
||||||
|
if (fadein == true) {
|
||||||
|
fadealpha -= 3;
|
||||||
|
if (fadealpha < 0) {
|
||||||
|
fadealpha = 0;
|
||||||
|
fadein = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (songIsFound == true) {
|
if (songIsFound == true) {
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
extern bool exiting;
|
extern bool exiting;
|
||||||
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||||
extern bool checkWifiStatus(void);
|
extern bool checkWifiStatus(void);
|
||||||
|
extern int fadealpha;
|
||||||
|
extern bool fadein;
|
||||||
|
|
||||||
u64 current = 0;
|
u64 current = 0;
|
||||||
u64 total = 100;
|
u64 total = 100;
|
||||||
@@ -58,6 +60,7 @@ void MainMenu::DrawMainMenu(void) const {
|
|||||||
Gui::DrawTop();
|
Gui::DrawTop();
|
||||||
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
|
Gui::DrawStringCentered(0, 2, 0.7f, Config::TxtColor, "Universal-Updater", 400);
|
||||||
Gui::DrawString(397-Gui::GetStringWidth(0.5f, V_STRING), 237-Gui::GetStringHeight(0.5f, V_STRING), 0.5f, Config::TxtColor, V_STRING);
|
Gui::DrawString(397-Gui::GetStringWidth(0.5f, V_STRING), 237-Gui::GetStringHeight(0.5f, V_STRING), 0.5f, Config::TxtColor, V_STRING);
|
||||||
|
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 400, 240, C2D_Color32(0, 0, 0, fadealpha)); // Fade in out effect
|
||||||
Gui::DrawBottom();
|
Gui::DrawBottom();
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
@@ -74,6 +77,7 @@ void MainMenu::DrawMainMenu(void) const {
|
|||||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SCRIPTCREATOR")))/2+150-70, mainButtons[3].y+10, 0.6f, Config::TxtColor, Lang::get("SCRIPTCREATOR"), 140);
|
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SCRIPTCREATOR")))/2+150-70, mainButtons[3].y+10, 0.6f, Config::TxtColor, Lang::get("SCRIPTCREATOR"), 140);
|
||||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SETTINGS")))/2-150+70, mainButtons[4].y+10, 0.6f, Config::TxtColor, Lang::get("SETTINGS"), 140);
|
Gui::DrawString((320-Gui::GetStringWidth(0.6f, Lang::get("SETTINGS")))/2-150+70, mainButtons[4].y+10, 0.6f, Config::TxtColor, Lang::get("SETTINGS"), 140);
|
||||||
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "FTP"))/2+150-70, mainButtons[5].y+10, 0.6f, Config::TxtColor, "FTP", 140);
|
Gui::DrawString((320-Gui::GetStringWidth(0.6f, "FTP"))/2+150-70, mainButtons[5].y+10, 0.6f, Config::TxtColor, "FTP", 140);
|
||||||
|
if (fadealpha > 0) Gui::Draw_Rect(0, 0, 320, 240, C2D_Color32(0, 0, 0, fadealpha)); // Fade in out effect
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainMenu::DisplayTestbar(void) const {
|
void MainMenu::DisplayTestbar(void) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user