mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 15:15:38 +00:00
25 lines
544 B
C
25 lines
544 B
C
|
#pragma once
|
||
|
|
||
|
#include "../GuiComponent.h"
|
||
|
#include <functional>
|
||
|
#include "../Font.h"
|
||
|
|
||
|
class ButtonComponent : public GuiComponent
|
||
|
{
|
||
|
public:
|
||
|
ButtonComponent(Window* window);
|
||
|
|
||
|
void setPressedFunc(std::function<void()> f);
|
||
|
|
||
|
bool input(InputConfig* config, Input input) override;
|
||
|
void render(const Eigen::Affine3f& parentTrans) override;
|
||
|
|
||
|
void setText(const std::string& text, unsigned int color);
|
||
|
private:
|
||
|
std::shared_ptr<Font> getFont();
|
||
|
std::function<void()> mPressedFunc;
|
||
|
|
||
|
std::string mText;
|
||
|
std::unique_ptr<TextCache> mTextCache;
|
||
|
};
|