The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'!
https://forums.lestoria.net
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
876 B
34 lines
876 B
1 year ago
|
#pragma once
|
||
|
#include "olcUTIL_Geometry2D.h"
|
||
|
#include "MenuType.h"
|
||
|
#include <functional>
|
||
|
|
||
|
class Menu;
|
||
|
class Crawler;
|
||
|
|
||
|
class MenuComponent{
|
||
|
friend class Menu;
|
||
|
MenuType menuDest;
|
||
|
std::string label;
|
||
|
MenuFunc onClick;
|
||
|
bool hovered=false;
|
||
|
private:
|
||
|
float hoverEffect=0;
|
||
|
protected:
|
||
|
geom2d::rect<float>rect;
|
||
|
public:
|
||
|
MenuComponent(geom2d::rect<float>rect,std::string label,MenuFunc onClick);
|
||
|
MenuComponent(geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick);
|
||
|
virtual void Update(Crawler*game);
|
||
|
virtual void Draw(Crawler*game,vf2d parentPos);
|
||
|
};
|
||
|
|
||
|
class MenuIconButton:public MenuComponent{
|
||
|
private:
|
||
|
Decal*icon;
|
||
|
public:
|
||
|
MenuIconButton(geom2d::rect<float>rect,Decal*icon,MenuFunc onClick);
|
||
|
protected:
|
||
|
virtual void Update(Crawler*game)override;
|
||
|
virtual void Draw(Crawler*game,vf2d parentPos)override;
|
||
|
};
|