Skip to content

Commit

Permalink
Improve Titlescreen
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrider3774 committed Aug 14, 2024
1 parent ef4afca commit 7629e4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/TitleScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ void TitleScreen()
GameState -= initDiff;
}

CGame_DrawTitleBackground();
CGame_DrawTitleBackground((gamepad_button_l() > 0) && (gamepad_button_r() > 0) && (CurrentMainMenu == -1));

SDL_Point FramePos = {ScreenWidth / 2, ScreenHeight / 2};
//Vec2F FrameScale = {2.5 * xscale, 7.6 *yscale};
Vec2F FrameScale = {FrameXScale * xscale, FrameYScale *yscale};
CImage_DrawImageFuze(GFXFrameID, 0, true, FramePos.x , FramePos.y, 0, FrameScale.x, FrameScale.y, 1.0, 1.0, 1.0, 0.95);
CImage_DrawImageFuze(GFXFrameID, 0, true, FramePos.x , FramePos.y, 0, FrameScale.x, FrameScale.y, 1.0, 1.0, 1.0, 0.90);
CImage_DrawImageFuze(GFXOuterFrameID, 0, true, FramePos.x , FramePos.y, 0, FrameScale.x, FrameScale.y, 1.0, 1.0, 1.0, 1.0);

TitleScreenAdjustFrameScaleValues();
Expand Down
22 changes: 21 additions & 1 deletion src/TitleScreenBackground.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ int menubackgroundx;
int menubackgroundy;
int menubackgrounddx;
int menubackgrounddy;
int pinc = ScreenWidth;
int funlen;
int[170] funmsg = "Hello to all Vircon32 Players and thanks to the FUZE Team and Wireframe magazine for doing a competition that made me initially create this game!!!!";


void CGame_CreateRandomBackground()
{
funlen = strlen(funmsg);
int x = 0;
int y = 0;
int r = rand() % Games;
Expand Down Expand Up @@ -54,7 +58,7 @@ void CGame_CreateRandomBackground()
menubackgrounddy = -1;
}

void CGame_DrawTitleBackground()
void CGame_DrawTitleBackground(bool k)
{
menubackgroundx += menubackgrounddx;
menubackgroundy += menubackgrounddy;
Expand All @@ -69,6 +73,22 @@ void CGame_DrawTitleBackground()
{
CImage_DrawImageFuze(GFXPrevewID, RandomBackground[x][y], false, -ScreenWidth+menubackgroundx + (int)(x*320*xscale), -ScreenHeight+menubackgroundy + (int)(y*180*yscale), 0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
}
if (k)
{
int[2] T;
for(int i = 0; i < funlen; i++)
{
int color = make_color_rgba(255, 128 + (sin(i*25 % 360 * pi/180))*127, 0, 64*3);
T[0] = funmsg[i];
T[1] = 0;
CFont_WriteText("Roboto-Regular", 40, T, pinc + i * 65, ((ScreenHeight / 2)) - 25 + (sin((((pinc + (i*15)) % 360)*pi/180)) * 150), color);
}
pinc = pinc- 2;
if (pinc < (int)(funlen * -65))
{
pinc = ScreenWidth;
}
}
}

#endif

0 comments on commit 7629e4e

Please sign in to comment.