Windowing System button controls, stack system, and custom functions implemented.
This commit is contained in:
+14
-7
@@ -1,17 +1,24 @@
|
||||
#pragma once
|
||||
#include "olcPixelGameEngine.h"
|
||||
#include "olcUTIL_Geometry2D.h"
|
||||
#include "MenuType.h"
|
||||
#include <functional>
|
||||
|
||||
class Menu;
|
||||
class Crawler;
|
||||
|
||||
class MenuButton{
|
||||
Menu*menuDest;
|
||||
vf2d size;
|
||||
friend class Menu;
|
||||
MenuType menuDest;
|
||||
geom2d::rect<float>rect;
|
||||
std::string label;
|
||||
Decal*icon;
|
||||
std::function<void()>onClick;
|
||||
|
||||
void Update(float fElapsedTime);
|
||||
void Draw(Crawler*game);
|
||||
MenuFunc onClick;
|
||||
bool hovered=false;
|
||||
private:
|
||||
float hoverEffect=0;
|
||||
public:
|
||||
MenuButton(geom2d::rect<float>rect,std::string label,Decal*icon,MenuFunc onClick);
|
||||
MenuButton(geom2d::rect<float>rect,std::string label,MenuType menuDest,Decal* icon,MenuFunc onClick);
|
||||
void Update(Crawler*game);
|
||||
void Draw(Crawler*game,vf2d parentPos);
|
||||
};
|
||||
Reference in New Issue
Block a user