olcPixelGameEngine v2.28
The official distribution of olcPixelGameEngine, a tool used in javidx9's YouTube videos and projects
Loading...
Searching...
No Matches
olc::popup::Menu Class Reference

#include <olcPGEX_PopUpMenu.h>

Public Member Functions

 Menu ()
 
 Menu (const std::string n)
 
MenuSetTable (int32_t nColumns, int32_t nRows)
 
MenuSetID (int32_t id)
 
MenuEnable (bool b)
 
int32_t GetID ()
 
std::string & GetName ()
 
bool Enabled ()
 
bool HasChildren ()
 
olc::vi2d GetSize ()
 
olc::vi2dGetCursorPosition ()
 
Menuoperator[] (const std::string &name)
 
void Build ()
 
void DrawSelf (olc::PixelGameEngine &pge, olc::Sprite *sprGFX, olc::vi2d vScreenOffset)
 
void ClampCursor ()
 
void OnUp ()
 
void OnDown ()
 
void OnLeft ()
 
void OnRight ()
 
MenuOnConfirm ()
 
MenuGetSelectedItem ()
 

Protected Attributes

int32_t nID = -1
 
olc::vi2d vCellTable = { 1, 0 }
 
std::unordered_map< std::string, size_t > itemPointer
 
std::vector< olc::popup::Menuitems
 
olc::vi2d vSizeInPatches = { 0, 0 }
 
olc::vi2d vCellSize = { 0, 0 }
 
olc::vi2d vCellPadding = { 2, 0 }
 
olc::vi2d vCellCursor = { 0, 0 }
 
int32_t nCursorItem = 0
 
int32_t nTopVisibleRow = 0
 
int32_t nTotalRows = 0
 
const olc::vi2d vPatchSize = { nPatch, nPatch }
 
std::string sName
 
olc::vi2d vCursorPos = { 0, 0 }
 
bool bEnabled = true
 

Constructor & Destructor Documentation

◆ Menu() [1/2]

olc::popup::Menu::Menu ( )

◆ Menu() [2/2]

olc::popup::Menu::Menu ( const std::string n)

Member Function Documentation

◆ Build()

void olc::popup::Menu::Build ( )

◆ ClampCursor()

void olc::popup::Menu::ClampCursor ( )

◆ DrawSelf()

void olc::popup::Menu::DrawSelf ( olc::PixelGameEngine & pge,
olc::Sprite * sprGFX,
olc::vi2d vScreenOffset )

◆ Enable()

Menu & olc::popup::Menu::Enable ( bool b)

◆ Enabled()

bool olc::popup::Menu::Enabled ( )

◆ GetCursorPosition()

olc::vi2d & olc::popup::Menu::GetCursorPosition ( )

◆ GetID()

int32_t olc::popup::Menu::GetID ( )

◆ GetName()

std::string & olc::popup::Menu::GetName ( )

◆ GetSelectedItem()

Menu * olc::popup::Menu::GetSelectedItem ( )

◆ GetSize()

olc::vi2d olc::popup::Menu::GetSize ( )

◆ HasChildren()

bool olc::popup::Menu::HasChildren ( )

◆ OnConfirm()

Menu * olc::popup::Menu::OnConfirm ( )

◆ OnDown()

void olc::popup::Menu::OnDown ( )

◆ OnLeft()

void olc::popup::Menu::OnLeft ( )

◆ OnRight()

void olc::popup::Menu::OnRight ( )

◆ OnUp()

void olc::popup::Menu::OnUp ( )

◆ operator[]()

Menu & olc::popup::Menu::operator[] ( const std::string & name)

◆ SetID()

Menu & olc::popup::Menu::SetID ( int32_t id)

◆ SetTable()

Menu & olc::popup::Menu::SetTable ( int32_t nColumns,
int32_t nRows )

Member Data Documentation

◆ bEnabled

bool olc::popup::Menu::bEnabled = true
protected

◆ itemPointer

std::unordered_map<std::string, size_t> olc::popup::Menu::itemPointer
protected

◆ items

std::vector<olc::popup::Menu> olc::popup::Menu::items
protected

◆ nCursorItem

int32_t olc::popup::Menu::nCursorItem = 0
protected

◆ nID

int32_t olc::popup::Menu::nID = -1
protected

◆ nTopVisibleRow

int32_t olc::popup::Menu::nTopVisibleRow = 0
protected

◆ nTotalRows

int32_t olc::popup::Menu::nTotalRows = 0
protected

◆ sName

std::string olc::popup::Menu::sName
protected

◆ vCellCursor

olc::vi2d olc::popup::Menu::vCellCursor = { 0, 0 }
protected

◆ vCellPadding

olc::vi2d olc::popup::Menu::vCellPadding = { 2, 0 }
protected

◆ vCellSize

olc::vi2d olc::popup::Menu::vCellSize = { 0, 0 }
protected

◆ vCellTable

olc::vi2d olc::popup::Menu::vCellTable = { 1, 0 }
protected

◆ vCursorPos

olc::vi2d olc::popup::Menu::vCursorPos = { 0, 0 }
protected

◆ vPatchSize

const olc::vi2d olc::popup::Menu::vPatchSize = { nPatch, nPatch }
protected

◆ vSizeInPatches

olc::vi2d olc::popup::Menu::vSizeInPatches = { 0, 0 }
protected

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