persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
MenuHUDScreen Class Reference

#include <MenuHUDScreen.hpp>

Inheritance diagram for MenuHUDScreen:
Collaboration diagram for MenuHUDScreen:

Public Member Functions

void load ()
 Loads graphics data into memory & pushes to VRAM.
void unload ()
 Unloads graphics data from memory.
void renderSprites () override
 Renders the background and sprites text to the screen.
int onTouch (touchPosition *touch) override
 Handles touch input.
void setTextComponent (TextComponent *text)
 Set the Text Component object.
void setTextContent (std::string textContent, TextColor textColor)
 Set the Text Content object.
Public Member Functions inherited from UIScreen
virtual void triggerAction (UIAction action)
 Trigger an action to be handled.
void removeSprites ()
 Clears the displayed sprites from the screen.
virtual ~UIScreen ()=default
 UIScreen (bool iIsMain)

Static Public Member Functions

static void create ()
static void destroy ()
static MenuHUDScreen * getInstance ()

Private Member Functions

 MenuHUDScreen ()
 ~MenuHUDScreen ()
void renderBackground ()
 Pushes background data into VRAM so that it is rendered on screen.
void renderText () override
 Prints the text to render on screen.

Private Attributes

ae::Entity * menuHUD = nullptr
GraphicsComponent * graphics = nullptr
TextComponent * text = nullptr
std::string textContent = ""
TextColor textColor = TextColor::White
const std::string bgPath = "graphics/MenuHUD/backgrounds/"
GraphicAsset bgHUD = {}
const std::string spritePath = "graphics/MenuHUD/sprites/"
Sprite moonSprite = {SpriteSize_32x32, SpriteColorFormat_16Color, 0}
GraphicAsset moonGraphic = {}
SpriteRenderState srs0 = {moonSprite, 206, 20, 1, 0, false, false, false, true}
SpritePayload sp0 = {srs0, spritePath, moonGraphic, SpriteType::MOON, (int)MoonSprite::MOON_0}
Sprite timeSprites [2]
GraphicAsset timeGraphics [2] = {}
SpriteRenderState srs6 = {timeSprites[0], 112, -5, 1, 0, false, false, false, true}
SpritePayload sp6 = {srs6, spritePath, timeGraphics[0], SpriteType::TIME, (int)TimeSprite::EARLY_MORNING_0_0}
SpriteRenderState srs7 = {timeSprites[1], 176, -5, 1, 0, false, false, false, true}
SpritePayload sp7 = {srs7, spritePath, timeGraphics[1], SpriteType::TIME, (int)TimeSprite::EARLY_MORNING_1_0}
Sprite skillSprite = {SpriteSize_16x16, SpriteColorFormat_16Color, 0}
GraphicAsset skillGraphic = {}
SpriteRenderState srs8 = {skillSprite, 25, 130, 1, 0, false, false, false, true}
SpritePayload sp8 = {srs8, spritePath, skillGraphic, SpriteType::SKILL_SPRITE, (int)SkillSprite::SKILLS_LEVEL}
etl::array< SpritePayload, 4 > spritePayloads = {sp0, sp6, sp7, sp8}
etl::array< SpriteTransform, 0 > spriteTransforms = {}

Static Private Attributes

static MenuHUDScreen * instance = nullptr

Additional Inherited Members

Public Attributes inherited from UIScreen
int bgId = -1
bool isMain = false
OamState * oam = nullptr
bool isLoaded = false
Protected Member Functions inherited from UIScreen
void moveSprite (int spriteId, int x, int y)
 Moves the specified sprite to the specified position on the screen.
void showSprite (int spriteId)
 Shows the specified sprite on the screen.
void hideSprite (int spriteId)
 Hides the specified sprite on the screen.

Detailed Description

Definition at line 15 of file MenuHUDScreen.hpp.

Constructor & Destructor Documentation

◆ MenuHUDScreen()

MenuHUDScreen::MenuHUDScreen ( )
inlineprivate

Definition at line 54 of file MenuHUDScreen.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~MenuHUDScreen()

MenuHUDScreen::~MenuHUDScreen ( )
inlineprivate

Definition at line 55 of file MenuHUDScreen.hpp.

Member Function Documentation

◆ create()

void MenuHUDScreen::create ( )
static

Definition at line 6 of file MenuHUDScreen.cpp.

Here is the call graph for this function:

◆ destroy()

void MenuHUDScreen::destroy ( )
static

Definition at line 14 of file MenuHUDScreen.cpp.

◆ getInstance()

MenuHUDScreen * MenuHUDScreen::getInstance ( )
static

Definition at line 23 of file MenuHUDScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

void MenuHUDScreen::load ( )
virtual

Loads graphics data into memory & pushes to VRAM.

Implements UIScreen.

Definition at line 103 of file MenuHUDScreen.cpp.

◆ onTouch()

int MenuHUDScreen::onTouch ( touchPosition * touch)
overridevirtual

Handles touch input.

Parameters
touchTouch input variable
Returns
int Touch input return code indicating what area of the screen was touched

Reimplemented from UIScreen.

Definition at line 88 of file MenuHUDScreen.cpp.

◆ renderBackground()

void MenuHUDScreen::renderBackground ( )
private

Pushes background data into VRAM so that it is rendered on screen.

Definition at line 32 of file MenuHUDScreen.cpp.

Here is the caller graph for this function:

◆ renderSprites()

void MenuHUDScreen::renderSprites ( )
overridevirtual

Renders the background and sprites text to the screen.

index -1 is reserved for vflip/hflip, 0 is reserved for no transform

Reimplemented from UIScreen.

Definition at line 42 of file MenuHUDScreen.cpp.

Here is the call graph for this function:

◆ renderText()

void MenuHUDScreen::renderText ( )
overrideprivatevirtual

Prints the text to render on screen.

Reimplemented from UIScreen.

Definition at line 190 of file MenuHUDScreen.cpp.

Here is the caller graph for this function:

◆ setTextComponent()

void MenuHUDScreen::setTextComponent ( TextComponent * text)

Set the Text Component object.

Parameters
textThe TextComponent pointer to set
Warning
This will be removed in the future in favour of a native dependency injection solution in Aegis Engine

Definition at line 178 of file MenuHUDScreen.cpp.

◆ setTextContent()

void MenuHUDScreen::setTextContent ( std::string textContent,
TextColor textColor )

Set the Text Content object.

Parameters
textContentThe text to print
textColorThe text colour to render the textContent in

Definition at line 183 of file MenuHUDScreen.cpp.

Here is the call graph for this function:

◆ unload()

void MenuHUDScreen::unload ( )
virtual

Unloads graphics data from memory.

Implements UIScreen.

Definition at line 135 of file MenuHUDScreen.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ bgHUD

GraphicAsset MenuHUDScreen::bgHUD = {}
private

Definition at line 76 of file MenuHUDScreen.hpp.

◆ bgPath

const std::string MenuHUDScreen::bgPath = "graphics/MenuHUD/backgrounds/"
private

Definition at line 75 of file MenuHUDScreen.hpp.

◆ graphics

GraphicsComponent* MenuHUDScreen::graphics = nullptr
private

Definition at line 69 of file MenuHUDScreen.hpp.

◆ instance

MenuHUDScreen * MenuHUDScreen::instance = nullptr
staticprivate

Definition at line 56 of file MenuHUDScreen.hpp.

◆ menuHUD

ae::Entity* MenuHUDScreen::menuHUD = nullptr
private

Definition at line 68 of file MenuHUDScreen.hpp.

◆ moonGraphic

GraphicAsset MenuHUDScreen::moonGraphic = {}
private

Definition at line 84 of file MenuHUDScreen.hpp.

◆ moonSprite

Sprite MenuHUDScreen::moonSprite = {SpriteSize_32x32, SpriteColorFormat_16Color, 0}
private

Definition at line 83 of file MenuHUDScreen.hpp.

◆ skillGraphic

GraphicAsset MenuHUDScreen::skillGraphic = {}
private

Definition at line 101 of file MenuHUDScreen.hpp.

◆ skillSprite

Sprite MenuHUDScreen::skillSprite = {SpriteSize_16x16, SpriteColorFormat_16Color, 0}
private

Definition at line 100 of file MenuHUDScreen.hpp.

◆ sp0

Definition at line 86 of file MenuHUDScreen.hpp.

◆ sp6

Definition at line 94 of file MenuHUDScreen.hpp.

◆ sp7

Definition at line 97 of file MenuHUDScreen.hpp.

◆ sp8

Definition at line 103 of file MenuHUDScreen.hpp.

◆ spritePath

const std::string MenuHUDScreen::spritePath = "graphics/MenuHUD/sprites/"
private

Definition at line 80 of file MenuHUDScreen.hpp.

◆ spritePayloads

etl::array<SpritePayload, 4> MenuHUDScreen::spritePayloads = {sp0, sp6, sp7, sp8}
private

Definition at line 106 of file MenuHUDScreen.hpp.

◆ spriteTransforms

etl::array<SpriteTransform, 0> MenuHUDScreen::spriteTransforms = {}
private

Definition at line 108 of file MenuHUDScreen.hpp.

◆ srs0

SpriteRenderState MenuHUDScreen::srs0 = {moonSprite, 206, 20, 1, 0, false, false, false, true}
private

Definition at line 85 of file MenuHUDScreen.hpp.

◆ srs6

SpriteRenderState MenuHUDScreen::srs6 = {timeSprites[0], 112, -5, 1, 0, false, false, false, true}
private

Definition at line 93 of file MenuHUDScreen.hpp.

◆ srs7

SpriteRenderState MenuHUDScreen::srs7 = {timeSprites[1], 176, -5, 1, 0, false, false, false, true}
private

Definition at line 96 of file MenuHUDScreen.hpp.

◆ srs8

SpriteRenderState MenuHUDScreen::srs8 = {skillSprite, 25, 130, 1, 0, false, false, false, true}
private

Definition at line 102 of file MenuHUDScreen.hpp.

◆ text

TextComponent* MenuHUDScreen::text = nullptr
private

Definition at line 70 of file MenuHUDScreen.hpp.

◆ textColor

TextColor MenuHUDScreen::textColor = TextColor::White
private

Definition at line 72 of file MenuHUDScreen.hpp.

◆ textContent

std::string MenuHUDScreen::textContent = ""
private

Definition at line 71 of file MenuHUDScreen.hpp.

◆ timeGraphics

GraphicAsset MenuHUDScreen::timeGraphics[2] = {}
private

Definition at line 91 of file MenuHUDScreen.hpp.

◆ timeSprites

Sprite MenuHUDScreen::timeSprites[2]
private
Initial value:
= {{SpriteSize_64x32, SpriteColorFormat_16Color, 0},
{SpriteSize_64x32, SpriteColorFormat_16Color, 0}}

Definition at line 89 of file MenuHUDScreen.hpp.


The documentation for this class was generated from the following files: