Carpenter Engine
A C++ game engine with a build once run anywhere solution
Loading...
Searching...
No Matches
UIInput.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_UIINPUT
8#define ENGINE_UIINPUT
9
10#include "UIElement.hpp"
11#include <string>
12
13namespace Engine::UI {
14
25 class UIInput : public UIElement {
26 const char* m_placeholder;
27 std::string m_value;
28
29 public:
30
41 UIInput(std::string name, const char* placeholder = "");
42
43 void Init() override;
44
50 int getInputInt();
51
57 double getInputDouble();
58
64 std::string getInputString();
65 };
66
67}
68
69#endif
Base class for UI elements.
Definition UIElement.hpp:24
An input field for UI.
Definition UIInput.hpp:25
void Init() override
Creates the UI element and adds it to the DOM.
Definition UIInput.cpp:20
std::string getInputString()
Returns the input as a string.
Definition UIInput.cpp:40
int getInputInt()
Returns the input as an integer.
Definition UIInput.cpp:28
double getInputDouble()
Returns the input as a double.
Definition UIInput.cpp:34