Implement framework for menu system

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/28/head
parent e846c61c53
commit 3cbb0d1e17
  1. 18
      Crawler/Menu.h
  2. 17
      Crawler/MenuButton.h
  3. BIN
      Crawler/assets/RetroMenu.png

@ -0,0 +1,18 @@
#pragma once
#include "MenuButton.h"
#include "olcPixelGameEngine.h"
#include <stack>
class Crawler;
class Menu{
std::stack<Menu*>*stack=nullptr;
std::vector<MenuButton>buttons;
vf2d size; //Size in tiles (24x24), every menu will be tile-based
Menu();
void AddButton(vf2d pos);
void Update(float fElapsedTime);
void Draw(Crawler*game);
};

@ -0,0 +1,17 @@
#pragma once
#include "olcPixelGameEngine.h"
#include <functional>
class Menu;
class Crawler;
class MenuButton{
Menu*menuDest;
vf2d size;
std::string label;
Decal*icon;
std::function<void()>onClick;
void Update(float fElapsedTime);
void Draw(Crawler*game);
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Loading…
Cancel
Save