diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Button.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/Button.h')
| -rw-r--r-- | Minecraft.Client/Button.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Minecraft.Client/Button.h b/Minecraft.Client/Button.h new file mode 100644 index 00000000..0bef133c --- /dev/null +++ b/Minecraft.Client/Button.h @@ -0,0 +1,30 @@ +#pragma once +#include "GuiComponent.h" +using namespace std; + +class Button : public GuiComponent +{ +protected: + int w; + int h; +public: + int x, y; + wstring msg; + int id; + bool active; + bool visible; + + Button(int id, int x, int y, const wstring& msg); + Button(int id, int x, int y, int w, int h, const wstring& msg); + void init(int id, int x, int y, int w, int h, const wstring& msg); // 4J - added +protected: + virtual int getYImage(bool hovered); +public: + virtual void render(Minecraft *minecraft, int xm, int ym); + +protected: + virtual void renderBg(Minecraft *minecraft, int xm, int ym); +public: + virtual void released(int mx, int my); + virtual bool clicked(Minecraft *minecraft, int mx, int my); +}; |
