Pacman Torben Petré
Loading...
Searching...
No Matches
MenuState Class Referencefinal

#include <MenuState.h>

Inheritance diagram for MenuState:
Collaboration diagram for MenuState:

Public Member Functions

 MenuState (StateManager &context)
 This State determines the main Pacman game menu.
void handleInput (const sf::Event::KeyEvent &keyPressed) override
 Will start the game when specific keys are a pressed. Also handles usernames.
void resized () override
 Will resize the contents of the Menu state.
void update (double dt) override
 Update the MenuState, is used for UI animations.
void render () override
 Renders the menu state.
Public Member Functions inherited from State
virtual ~State ()=default

Additional Inherited Members

Protected Member Functions inherited from State
 State (StateManager &ctx)
 Creates the base State object.
Protected Attributes inherited from State
StateManagercontext

Constructor & Destructor Documentation

◆ MenuState()

MenuState::MenuState ( StateManager & context)
explicit

This State determines the main Pacman game menu.

Parameters
contextStateManager

Member Function Documentation

◆ handleInput()

void MenuState::handleInput ( const sf::Event::KeyEvent & keyPressed)
overridevirtual

Will start the game when specific keys are a pressed. Also handles usernames.

In MenuState you have to set a username. The keys a through z, A through Z, _ and - will result in their respective letters getting appended to your username.

Warning
Username changing has not been tested with AZERTY
Parameters
keyPressedSFML KeyEvent
Warning
Username changing has not been tested with AZERTY keyboard layouts.

Implements State.

◆ render()

void MenuState::render ( )
overridevirtual

Renders the menu state.

Implements State.

◆ resized()

void MenuState::resized ( )
overridevirtual

Will resize the contents of the Menu state.

Implements State.

◆ update()

void MenuState::update ( double dt)
overridevirtual

Update the MenuState, is used for UI animations.

Parameters
dtDeltatime

Implements State.


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