Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
MenuToggle Class Reference

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 Texturetid = nullptr
 Text texture.
 

Additional Inherited Members

- Public Types inherited from MenuButton
enum class  State : uint { OFF , HOVER , ON }
 Button state.
 

Detailed Description

Represents a toggle in a menu.

Inherits MenuButton.

Constructor & Destructor Documentation

◆ MenuToggle()

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.

Parameters
screenPosposition on screen in absolute units
meshSizethe size of the checkbox mesh
screenScalescaling to apply to the toggle on the X axis
actionTagthe ID of the action associated to this button
texturethe text texture accompanying the checkbox

The documentation for this class was generated from the following files: