Nano v1.0.0
Simulating Natural Selection
ss::pl::mainMenu::MainMenu Class Reference

#include <MainMenu.h>

Inheritance diagram for ss::pl::mainMenu::MainMenu:
Scene

Classes

struct  graphsCard
 

Public Member Functions

 MainMenu (std::string sceneName, SceneManager &sceneManager)
 Constructor for the MainMenu class. More...
 
virtual void Start ()
 Method which is called in the start of the MainMenu page. More...
 
virtual void Update ()
 Method which is called every frame. More...
 
virtual void onExit ()
 Method which is called when we exit the program or the MainMenu page. More...
 
virtual void loadAssets ()
 Method for loading all the needed assets in the graph page. More...
 
virtual void deleteAssets ()
 Method for deallocating the dynamically created assets. More...
 
- Public Member Functions inherited from Scene
 Scene (std::string sceneName)
 
virtual void Start ()=0
 
virtual void Update ()=0
 
virtual void onExit ()=0
 
virtual void loadAssets ()=0
 
virtual void deleteAssets ()=0
 

Private Member Functions

void handleScroll ()
 Method for handling the scroll button. More...
 
bool handleMouseCursor ()
 Method for handling when the mouse cursor is on click. More...
 
void checkCollision ()
 Method for checking collision on every possible button. More...
 
void checkGraphButtonCollisions ()
 Method for checking which of the graph buttons is clicked. More...
 
float calculateGraphsContainer ()
 Method for calculating the Graph container's place. More...
 
void animateGraphsContainer ()
 Method for slowing down the showing of the graph container. More...
 
void positionGraphsContainer ()
 Method for positioning the graph container through the animation. More...
 
void displayGraphCards ()
 Method for displaying the graph cards on click on the menu. More...
 
void playThemeAnimation ()
 Method for displaying the theme switch animation. More...
 
void drawTextures ()
 Method for drawing all the needed assets in the MainMenu page. More...
 

Private Attributes

SceneManagerm_sceneManager
 
Vector2 mousePos
 
Vector2 currentGraphPos
 
int scrollOffset = 0
 
Texture2D simulatorButton_Texture
 
Texture2D logo_Texture
 
Texture2D graphsContainer_Texture
 
Texture2D statisticCard_Texture
 
Texture2D graphsMenu_Texture
 
Texture2D themeButton_Texture
 
Texture2D viewGraph_Texture
 
Texture2D background_Lines
 
Texture2D currentFrameTexture
 
int currentAnimationFrame = 0
 
bool animationIsPlaying = false
 
Font fontInter
 
Vector2 graphNamePos
 
Vector2 graphButtonPos
 
std::vector< std::string > statisticNames
 
std::vector< graphsCardgraphCards
 
bool graphsIsAnimatingIn = false
 
bool graphsIsAnimatingOut = false
 
bool graphsIsOut = false
 
float graphsContainerPos = -887
 
float graphContainerAnimationEase = 3000
 

Additional Inherited Members

- Public Types inherited from Scene
enum class  ThemeTypes { LightTheme , DarkTheme }
 
- Public Attributes inherited from Scene
bool isSetUp = false
 
std::string m_sceneName
 
- Static Public Attributes inherited from Scene
static ThemeTypes currentTheme = ThemeTypes::LightTheme
 
static const std::array< std::string, 2 > themePaths = {"lightTheme", "darkTheme"}
 
static const std::array< Color, 2 > backgroundColors {{{239, 239, 239, 255}, {5, 11, 30, 255}}}
 

Constructor & Destructor Documentation

◆ MainMenu()

ss::pl::mainMenu::MainMenu::MainMenu ( std::string  sceneName,
SceneManager sceneManager 
)

Constructor for the MainMenu class.

Parameters
sceneNameThe name of the current scene. Which here is "MainMenu".
sceneManagerA reference to already existing SceneManager object to control the program flow.

Member Function Documentation

◆ animateGraphsContainer()

void ss::pl::mainMenu::MainMenu::animateGraphsContainer ( )
private

Method for slowing down the showing of the graph container.

◆ calculateGraphsContainer()

float ss::pl::mainMenu::MainMenu::calculateGraphsContainer ( )
private

Method for calculating the Graph container's place.

Returns
The possition in float.

◆ checkCollision()

void ss::pl::mainMenu::MainMenu::checkCollision ( )
private

Method for checking collision on every possible button.

◆ checkGraphButtonCollisions()

void ss::pl::mainMenu::MainMenu::checkGraphButtonCollisions ( )
private

Method for checking which of the graph buttons is clicked.

◆ deleteAssets()

void ss::pl::mainMenu::MainMenu::deleteAssets ( )
virtual

Method for deallocating the dynamically created assets.

Implements Scene.

◆ displayGraphCards()

void ss::pl::mainMenu::MainMenu::displayGraphCards ( )
private

Method for displaying the graph cards on click on the menu.

◆ drawTextures()

void ss::pl::mainMenu::MainMenu::drawTextures ( )
private

Method for drawing all the needed assets in the MainMenu page.

◆ handleMouseCursor()

bool ss::pl::mainMenu::MainMenu::handleMouseCursor ( )
private

Method for handling when the mouse cursor is on click.

Returns
bool.

◆ handleScroll()

void ss::pl::mainMenu::MainMenu::handleScroll ( )
private

Method for handling the scroll button.

◆ loadAssets()

void ss::pl::mainMenu::MainMenu::loadAssets ( )
virtual

Method for loading all the needed assets in the graph page.

Implements Scene.

◆ onExit()

void ss::pl::mainMenu::MainMenu::onExit ( )
virtual

Method which is called when we exit the program or the MainMenu page.

It deallocates every dynamically created object in the class' instance.

Implements Scene.

◆ playThemeAnimation()

void ss::pl::mainMenu::MainMenu::playThemeAnimation ( )
private

Method for displaying the theme switch animation.

◆ positionGraphsContainer()

void ss::pl::mainMenu::MainMenu::positionGraphsContainer ( )
private

Method for positioning the graph container through the animation.

◆ Start()

void ss::pl::mainMenu::MainMenu::Start ( )
virtual

Method which is called in the start of the MainMenu page.

Implements Scene.

◆ Update()

void ss::pl::mainMenu::MainMenu::Update ( )
virtual

Method which is called every frame.

It updates the current scene every frame.

Implements Scene.

Member Data Documentation

◆ animationIsPlaying

bool ss::pl::mainMenu::MainMenu::animationIsPlaying = false
private

◆ background_Lines

Texture2D ss::pl::mainMenu::MainMenu::background_Lines
private

◆ currentAnimationFrame

int ss::pl::mainMenu::MainMenu::currentAnimationFrame = 0
private

◆ currentFrameTexture

Texture2D ss::pl::mainMenu::MainMenu::currentFrameTexture
private

◆ currentGraphPos

Vector2 ss::pl::mainMenu::MainMenu::currentGraphPos
private

◆ fontInter

Font ss::pl::mainMenu::MainMenu::fontInter
private

◆ graphButtonPos

Vector2 ss::pl::mainMenu::MainMenu::graphButtonPos
private

◆ graphCards

std::vector<graphsCard> ss::pl::mainMenu::MainMenu::graphCards
private

◆ graphContainerAnimationEase

float ss::pl::mainMenu::MainMenu::graphContainerAnimationEase = 3000
private

◆ graphNamePos

Vector2 ss::pl::mainMenu::MainMenu::graphNamePos
private

◆ graphsContainer_Texture

Texture2D ss::pl::mainMenu::MainMenu::graphsContainer_Texture
private

◆ graphsContainerPos

float ss::pl::mainMenu::MainMenu::graphsContainerPos = -887
private

◆ graphsIsAnimatingIn

bool ss::pl::mainMenu::MainMenu::graphsIsAnimatingIn = false
private

◆ graphsIsAnimatingOut

bool ss::pl::mainMenu::MainMenu::graphsIsAnimatingOut = false
private

◆ graphsIsOut

bool ss::pl::mainMenu::MainMenu::graphsIsOut = false
private

◆ graphsMenu_Texture

Texture2D ss::pl::mainMenu::MainMenu::graphsMenu_Texture
private

◆ logo_Texture

Texture2D ss::pl::mainMenu::MainMenu::logo_Texture
private

◆ m_sceneManager

SceneManager& ss::pl::mainMenu::MainMenu::m_sceneManager
private

◆ mousePos

Vector2 ss::pl::mainMenu::MainMenu::mousePos
private

◆ scrollOffset

int ss::pl::mainMenu::MainMenu::scrollOffset = 0
private

◆ simulatorButton_Texture

Texture2D ss::pl::mainMenu::MainMenu::simulatorButton_Texture
private

◆ statisticCard_Texture

Texture2D ss::pl::mainMenu::MainMenu::statisticCard_Texture
private

◆ statisticNames

std::vector<std::string> ss::pl::mainMenu::MainMenu::statisticNames
private

◆ themeButton_Texture

Texture2D ss::pl::mainMenu::MainMenu::themeButton_Texture
private

◆ viewGraph_Texture

Texture2D ss::pl::mainMenu::MainMenu::viewGraph_Texture
private

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