Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
MainMenuScreen Class Reference

The main menu screen for the game. More...

#include <MainMenuScreen.h>

Inheritance diagram for MainMenuScreen:

Public Member Functions

 MainMenuScreen ()
 Instantiate a main menu screen object.
 
virtual ~MainMenuScreen ()
 
virtual void LoadContent (ResourceManager &resourceManager)
 Load the content for the screen.
 
virtual void Update (const GameTime &gameTime)
 Unload the content for the screen.
 
virtual void Draw (SpriteBatch &spriteBatch)
 Render the screen.
 
virtual void SetQuittingGame ()
 Set the flag to quit the game, so the game will exit when screen fades out.
 
virtual bool IsQuittingGame ()
 Check if the game is quitting.
 
- Public Member Functions inherited from KatanaEngine::MenuScreen
 MenuScreen ()
 
virtual ~MenuScreen ()
 
virtual void HandleInput (const InputState &input)
 Called when the game has determined that player input needs to be processed.
 
virtual void SetItemListWrapping (const bool wraps)
 Sets whether scrolling past the end of the menu returns the selection back to the first item.
 
- Public Member Functions inherited from KatanaEngine::Screen
 Screen ()
 
virtual ~Screen ()
 
virtual void UnloadContent ()
 Called when resources need to be unloaded. Override this method to unload any screen-specific resources.
 
virtual bool IsExiting () const
 Determines if the screen is currently exiting.
 
float GetAlpha () const
 Gets the overall screen transition alpha value (or opacity). This is handy for fading screens in and out.
 
virtual ScreenManagerGetScreenManager ()
 Gets a pointer to the ScreenManager, for managing game screens.
 
virtual GameGetGame () const
 Gets a pointer to the Game.
 
virtual void SetScreenManager (ScreenManager &screenManager)
 Gets a pointer to the ScreenManager, for managing game screens.
 
virtual void Show ()
 Tells the screen to transition in.
 
virtual void Exit ()
 Tells the screen to transition out. When the screen has completed its transition, UnloadContent() will be called, and the ScreenManager will remove it.
 
virtual void SetExitCallback (OnExit callback)
 Sets the callback function for when the Exit() is called.
 
virtual void SetRemoveCallback (OnRemove callback)
 Sets the callback function for when the screen is about to be removed by the screen manager.
 
virtual double GetTransitionOutTime () const
 Get the time in seconds that the screen will transition out.
 

Additional Inherited Members

- Protected Types inherited from KatanaEngine::Screen
enum class  ScreenTransition { None , In , Out }
 Defines the state of the transition between screens. More...
 
- Protected Member Functions inherited from KatanaEngine::MenuScreen
virtual void AddMenuItem (MenuItem *pItem)
 Adds a menu item to the screen.
 
virtual MenuItemGetSelectedItem () const
 Get the currently selected menu item.
 
virtual MenuItemGetMenuItem (const int itemIndex) const
 Get a menu item by providing it's index.
 
virtual void SetSelectedItem (const int itemIndex)
 Set the selected menu item by providing it's index.
 
virtual void SetDisplayCount (const unsigned int count)
 Set how many menu items to display.
 
virtual int GetDisplayCount () const
 Get the number of menu items that are set to display.
 
virtual size_t GetCount () const
 Get the total number of menu items.
 
virtual int GetDisplayStartIndex () const
 Get the index corresponding to the first displayed menu item.
 
- Protected Member Functions inherited from KatanaEngine::Screen
virtual bool ShouldHandleInputBelow ()
 Checks if the screen manager should call HandleInput on the screen below this one.
 
virtual bool ShouldUpdateBelow ()
 Checks if the screen manager should call Update on the screen below this one.
 
virtual bool ShouldDrawBelow ()
 Checks if the screen manager should call Draw on the screen below this one.
 
virtual void SetTransitionInTime (double seconds)
 Set the time in seconds that the screen should transition in.
 
virtual void SetTransitionOutTime (double seconds)
 Set the time in seconds that the screen should transition out.
 
virtual double GetTransitionInTime () const
 Get the time in seconds that the screen will transition in.
 
virtual ScreenTransition GetTransition () const
 Get the current transition state of the screen.
 
virtual float GetTransitionValue () const
 Get the interpolated value (between zero and one) of the screen transition.
 
virtual bool NeedsToBeRemoved () const
 Determines if the screen has completely faded out and needs to be removed by the ScreenManager.
 
virtual void UseRenderTarget ()
 Forces all screen rendering to a render target.
 
virtual RenderTargetGetRenderTarget () const
 Get screen's render target.
 
virtual Color GetRenderTargetColor () const
 Get the color that will be used to tint the render target.
 

Detailed Description

The main menu screen for the game.

Definition at line 8 of file MainMenuScreen.h.

Constructor & Destructor Documentation

◆ MainMenuScreen()

MainMenuScreen::MainMenuScreen ( )

Instantiate a main menu screen object.

Definition at line 39 of file MainMenuScreen.cpp.

◆ ~MainMenuScreen()

virtual MainMenuScreen::~MainMenuScreen ( )
inlinevirtual

Definition at line 15 of file MainMenuScreen.h.

Member Function Documentation

◆ Draw()

void MainMenuScreen::Draw ( SpriteBatch & spriteBatch)
virtual

Render the screen.

Parameters
spriteBatchA reference to the game's sprite batch, used for rendering.

Reimplemented from KatanaEngine::MenuScreen.

Definition at line 95 of file MainMenuScreen.cpp.

◆ IsQuittingGame()

virtual bool MainMenuScreen::IsQuittingGame ( )
inlinevirtual

Check if the game is quitting.

Returns
True if the game is quitting.

Definition at line 34 of file MainMenuScreen.h.

◆ LoadContent()

void MainMenuScreen::LoadContent ( ResourceManager & resourceManager)
virtual

Load the content for the screen.

Parameters
resourceManagerA reference to the game's resource manager, used for loading and managing game assets (resources).

Reimplemented from KatanaEngine::Screen.

Definition at line 49 of file MainMenuScreen.cpp.

◆ SetQuittingGame()

virtual void MainMenuScreen::SetQuittingGame ( )
inlinevirtual

Set the flag to quit the game, so the game will exit when screen fades out.

Definition at line 30 of file MainMenuScreen.h.

◆ Update()

void MainMenuScreen::Update ( const GameTime & gameTime)
virtual

Unload the content for the screen.

Reimplemented from KatanaEngine::MenuScreen.

Definition at line 80 of file MainMenuScreen.cpp.


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