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.
|
|
|
#pragma once
|
|
|
|
#include "olcUTIL_Geometry2D.h"
|
|
|
|
#include "MenuType.h"
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
class Menu;
|
|
|
|
class Crawler;
|
|
|
|
|
|
|
|
class MenuComponent{
|
|
|
|
friend class Menu;
|
|
|
|
MenuType menuDest;
|
|
|
|
MenuFunc onClick;
|
|
|
|
bool hovered=false;
|
|
|
|
bool selectable=true;
|
|
|
|
private:
|
|
|
|
float hoverEffect=0;
|
|
|
|
protected:
|
|
|
|
geom2d::rect<float>rect;
|
|
|
|
std::string label;
|
|
|
|
bool border=true;
|
|
|
|
public:
|
|
|
|
MenuComponent(geom2d::rect<float>rect,std::string label,MenuFunc onClick,bool selectable=true);
|
|
|
|
MenuComponent(geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,bool selectable=true);
|
|
|
|
virtual void Update(Crawler*game);
|
|
|
|
virtual void Draw(Crawler*game,vf2d parentPos);
|
|
|
|
};
|