Add backgrounds for game title text

This commit is contained in:
RocketRobz 2020-06-07 20:43:15 -06:00
parent 30e1503583
commit e94e3eae34
11 changed files with 28 additions and 8 deletions

View File

@ -54,7 +54,7 @@ UNIVCORE := Universal-Core
SOURCES := $(UNIVCORE) source source/screens source/utils
DATA := data
INCLUDES := $(UNIVCORE) include include/screens include/utils
GRAPHICS := assets/gfx assets/gfx_chars assets/gfx_charprevbg assets/gfx_gamesel assets/gfx_gameshots
GRAPHICS := assets/gfx assets/gfx_chars assets/gfx_charprevbg assets/gfx_gamesel assets/gfx_gameshots assets/gfx_gamebg
ROMFS := romfs
GFXBUILD := $(ROMFS)/gfx
APP_AUTHOR := RocketRobz

View File

@ -0,0 +1,7 @@
--atlas -f rgba -z auto
title1_bg.png
title1_bgE.png
title2_bg.png
title3_bg.png
title4_bg.png
title4_bgE.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -4,6 +4,7 @@
#include "sprites.h"
#include "gameSelSprites.h"
#include "gameShotSprites.h"
#include "gameBgSprites.h"
#include <3ds.h>
#include <citro2d.h>
@ -34,6 +35,7 @@ namespace GFX {
void showCharSprite(int zoomIn, int fadeAlpha);
void DrawGameSelSprite(int img, int x, int y, float ScaleX = 1, float ScaleY = 1);
void DrawGameShotSprite(int img, int x, int y, float ScaleX = 1, float ScaleY = 1);
void DrawGameBgSprite(int img, int x, int y, float ScaleX = 1, float ScaleY = 1);
void DrawSprite(int img, int x, int y, float ScaleX = 1, float ScaleY = 1, GPU_TEXTURE_FILTER_PARAM filter = GPU_NEAREST);
void DrawSpriteBlend(int img, float x, float y, u32 color, float ScaleX = 1, float ScaleY = 1, GPU_TEXTURE_FILTER_PARAM filter = GPU_NEAREST);

View File

@ -5,6 +5,7 @@
static C2D_SpriteSheet sprites;
static C2D_SpriteSheet gameSelSprites;
static C2D_SpriteSheet gameShotSprites;
static C2D_SpriteSheet gameBgSprites;
static C2D_SpriteSheet bgSprite;
static C2D_SpriteSheet chracterSprite;
static bool doChracterSpriteFree = false;
@ -22,6 +23,7 @@ Result GFX::loadSheets() {
sprites = C2D_SpriteSheetLoad("romfs:/gfx/sprites.t3x");
gameSelSprites = C2D_SpriteSheetLoad("romfs:/gfx/gameSelSprites.t3x");
gameShotSprites = C2D_SpriteSheetLoad("romfs:/gfx/gameShotSprites.t3x");
gameBgSprites = C2D_SpriteSheetLoad("romfs:/gfx/gameBgSprites.t3x");
GFX::loadBgSprite();
return 0;
}
@ -30,6 +32,7 @@ Result GFX::unloadSheets() {
C2D_SpriteSheetFree(sprites);
C2D_SpriteSheetFree(gameSelSprites);
C2D_SpriteSheetFree(gameShotSprites);
C2D_SpriteSheetFree(gameBgSprites);
if (doBgSpriteFree) {
C2D_SpriteSheetFree(bgSprite);
}
@ -115,6 +118,10 @@ void GFX::DrawGameShotSprite(int img, int x, int y, float ScaleX, float ScaleY)
C2D_DrawImageAt(C2D_SpriteSheetGetImage(gameShotSprites, img), x, y, 0.5f, NULL, ScaleX, ScaleY);
}
void GFX::DrawGameBgSprite(int img, int x, int y, float ScaleX, float ScaleY) {
C2D_DrawImageAt(C2D_SpriteSheetGetImage(gameBgSprites, img), x, y, 0.5f, NULL, ScaleX, ScaleY);
}
void GFX::DrawSprite(int img, int x, int y, float ScaleX, float ScaleY, GPU_TEXTURE_FILTER_PARAM filter) {
C2D_Image image = C2D_SpriteSheetGetImage(sprites, img);
C3D_TexSetFilter(image.tex, filter, filter);

View File

@ -90,29 +90,33 @@ void GameSelect::Draw(void) const {
}
Gui::ScreenDraw(Bottom);
Gui::Draw_Rect(0, 0, 320, 240, WHITE); // Fill gaps of BG
switch(highlightedGame) {
case 0:
default:
/*Gui::Draw_Rect(0, 0, 320, 240, WHITE); // Fill gaps of BG
for(int w = 0; w < 7; w++) {
for(int h = 0; h < 3; h++) {
GFX::DrawSprite(sprites_phone_bg_idx, -76+bg_xPos+w*72, bg_yPos+h*136);
}
}
Gui::DrawString(8, 8, 0.50, BLACK, "Select a game to manage its save data.");
switch(highlightedGame) {
case 0:
default:
}*/
GFX::DrawGameBgSprite((sysRegion==CFG_REGION_EUR || sysRegion==CFG_REGION_AUS) ? gameBgSprites_title1_bgE_idx : gameBgSprites_title1_bg_idx, 0, 0, 2, 2);
GFX::DrawGameSelSprite(ss1Logo, ss1LogoXpos, 56);
break;
case 1:
GFX::DrawGameBgSprite(gameBgSprites_title2_bg_idx, 0, 0);
GFX::DrawGameSelSprite(ss2Logo, ssLogoXpos, 56);
break;
case 2:
GFX::DrawGameBgSprite(gameBgSprites_title3_bg_idx, 0, 0);
GFX::DrawGameSelSprite(ss3Logo, 0, 56);
break;
case 3:
GFX::DrawGameBgSprite((sysRegion==CFG_REGION_EUR || sysRegion==CFG_REGION_AUS) ? gameBgSprites_title4_bgE_idx : gameBgSprites_title4_bg_idx, 0, 0);
GFX::DrawGameSelSprite(ss4Logo, ssLogoXpos, 56);
break;
}
Gui::DrawString(8, 8, 0.50, BLACK, "Select a game to manage its save data.");
Gui::DrawString(8, 112, 0.55, BLACK, "<");
Gui::DrawString(304, 112, 0.55, BLACK, ">");
Gui::DrawString(8, 202, 0.50, BLACK, "START: Exit");