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

A dynamic text label. More...

#include <GameMenu.hpp>

Public Member Functions

 MenuLabel (const glm::vec2 &screenPos, float verticalScale, const Font *font, Font::Alignment alignment)
 
void update (const std::string &text)
 

Public Attributes

Mesh mesh = Mesh("")
 Label mesh.
 
glm::vec2 pos = glm::vec2(0.0f)
 Label position.
 
const Texturetid = nullptr
 Font texture shortcut.
 

Private Attributes

float _vScale = 1.0f
 Vertical size on screen.
 
const Font_font = nullptr
 Font atlas.
 
Font::Alignment _align = Font::Alignment::LEFT
 Text alignement.
 

Detailed Description

A dynamic text label.

Constructor & Destructor Documentation

◆ MenuLabel()

MenuLabel::MenuLabel ( const glm::vec2 &  screenPos,
float  verticalScale,
const Font font,
Font::Alignment  alignment 
)

Creates a label. The position is in the bottom left corner if the alignment is LEFT, the bottom right if the alignment is RIGHT, and in the middle of the label if it is CENTER.

Parameters
screenPosposition on screen in absolute units
verticalScaleheight of the characters in absolute units
fontthe font to use
alignmentthe text alignment to use

Member Function Documentation

◆ update()

void MenuLabel::update ( const std::string &  text)

Update the string displayed by the label.

Parameters
textthe new text to display

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