Carpenter Engine
A C++ game engine with a build once run anywhere solution
Loading...
Searching...
No Matches
UIButton.hpp
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 */
6
7#ifndef ENGINE_UIBUTTON
8#define ENGINE_UIBUTTON
9
10#include "UILabel.hpp"
11#include <emscripten/html5.h>
12
13namespace Engine::UI {
14
23 class UIButton : public UILabel {
24 private:
25
35 static bool m_mouseClickEmscripten(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
36
37 public:
38
48 UIButton(std::string name, std::string text, void (&callback)());
49
53 void Init() override;
54
58 void (&OnClick)();
59
60 };
61
62}
63
64#endif
A Button associated with a scene.
Definition UIButton.hpp:23
void(&) OnClick()
reference to the function to be called when the button is clicked
Definition UIButton.hpp:58
void Init() override
Definition UIButton.cpp:21
A Label associated with a scene.
Definition UILabel.hpp:23