|
Rendu
A lightweight rendering engine for experimentations
|
Represents a toggle in a menu. More...
#include <GameMenu.hpp>
Public Member Functions | |
| MenuToggle (const glm::vec2 &screenPos, const glm::vec2 &meshSize, float screenScale, int actionTag, const Texture *texture) | |
Public Member Functions inherited from MenuButton | |
| MenuButton (const glm::vec2 &screenPos, const glm::vec2 &meshSize, float screenScale, int actionTag, const Texture *texture) | |
| bool | contains (const glm::vec2 &mousePos) const |
Public Attributes | |
| glm::vec2 | posBox = glm::vec2(0.0f) |
| Screen position of the toggle box. | |
| glm::vec2 | posImg = glm::vec2(0.0f) |
| Screen position of the text. | |
| glm::vec2 | scaleBox = glm::vec2(1.0f) |
| Scaling of the toggle box. | |
| const float | checkBoxScale = 0.65f |
| Scaling of checkboxes compared to regular buttons. | |
Public Attributes inherited from MenuButton | |
| State | state = State::OFF |
| The button interaction state. | |
| glm::vec2 | pos = glm::vec2(0.0f) |
| Screen position. | |
| glm::vec2 | size = glm::vec2(1.0f) |
| Screen size. | |
| glm::vec2 | scale = glm::vec2(1.0f) |
| Screen scale. | |
| float | displayScale = 1.0f |
| Initial display scale. | |
| int | tag = 0 |
| Action ID. | |
| const Texture * | tid = nullptr |
| Text texture. | |
Additional Inherited Members | |
Public Types inherited from MenuButton | |
| enum class | State : uint { OFF , HOVER , ON } |
| Button state. | |
Represents a toggle in a menu.
Inherits MenuButton.
| MenuToggle::MenuToggle | ( | const glm::vec2 & | screenPos, |
| const glm::vec2 & | meshSize, | ||
| float | screenScale, | ||
| int | actionTag, | ||
| const Texture * | texture | ||
| ) |
Creates a new toggle button which can be either on or off.
| screenPos | position on screen in absolute units |
| meshSize | the size of the checkbox mesh |
| screenScale | scaling to apply to the toggle on the X axis |
| actionTag | the ID of the action associated to this button |
| texture | the text texture accompanying the checkbox |