Skip to content

Class i_2D::Menu

ClassList > i_2D > Menu

Public Functions

Type Name
void ConstructInventory (const std::vector< std::string > & interfaceAgentInventory)
Builds an inventory.
void DeconstructInventory ()
Destroy the inventory object.
void DrawTo (sf::RenderWindow & window)
draws each menu button to the window
std::vector< std::unique_ptr< Button > > & GetMenu ()
Getter for MenuBar.
void HandleMouseButtonPressed (sf::RenderWindow & window, const std::vector< std::string > & interfaceAgentInventory)
check if the mouse click the exit button closes window accordingly
std::string HandleMouseMove (sf::RenderWindow & window)
check for mouse hoovering over the menu buttons change button color accordingly
void Initialize (sf::Font & font, sf::Vector2f size)
initialize the buttons at the top of the window
bool IsInventoryOpen ()
Check if the inventory interface is open.
void SetInventoryItemDisplay (sf::Texture & texture)
void SetWorldSize (sf::Vector2f size)
Keep track of the world's size.

Public Functions Documentation

function ConstructInventory

inline void i_2D::Menu::ConstructInventory (
    const std::vector< std::string > & interfaceAgentInventory
) 

function DeconstructInventory

inline void i_2D::Menu::DeconstructInventory () 

function DrawTo

draws each menu button to the window

void i_2D::Menu::DrawTo (
    sf::RenderWindow & window
) 

Parameters:

  • window the main window of the graphic interface

function GetMenu

Getter for MenuBar.

inline std::vector< std::unique_ptr< Button > > & i_2D::Menu::GetMenu () 

Returns:

MenuBar

function HandleMouseButtonPressed

check if the mouse click the exit button closes window accordingly

void i_2D::Menu::HandleMouseButtonPressed (
    sf::RenderWindow & window,
    const std::vector< std::string > & interfaceAgentInventory
) 

Parameters:

  • window the main window of the graphic interface

function HandleMouseMove

check for mouse hoovering over the menu buttons change button color accordingly

std::string i_2D::Menu::HandleMouseMove (
    sf::RenderWindow & window
) 

Parameters:

  • window the main window of the graphic interface

function Initialize

void i_2D::Menu::Initialize (
    sf::Font & font,
    sf::Vector2f size
) 

function IsInventoryOpen

Check if the inventory interface is open.

inline bool i_2D::Menu::IsInventoryOpen () 

Returns:

True if inventory interface is on, otherwise false

function SetInventoryItemDisplay

inline void i_2D::Menu::SetInventoryItemDisplay (
    sf::Texture & texture
) 

Parameters:

  • texture

function SetWorldSize

Keep track of the world's size.

inline void i_2D::Menu::SetWorldSize (
    sf::Vector2f size
) 

Parameters:

  • size Size of the world

The documentation for this class was generated from the following file source/Interfaces/Menu.hpp