MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / Label

Class Label

extensions/olcPGEX_QuickGUI.h:175–202  ·  view source on GitHub ↗

Creates a Label Control - it's just text!

Source from the content-addressed store, hash-verified

173
174 // Creates a Label Control - it's just text!
175 class Label : public BaseControl
176 {
177 public:
178 Label(olc::QuickGUI::Manager& manager, // Associate with a Manager
179 const std::string& text, // Text to display
180 const olc::vf2d& pos, // Location of label top-left
181 const olc::vf2d& size); // Size of label
182
183 public:
184 // Position of button
185 olc::vf2d vPos;
186 // Size of button
187 olc::vf2d vSize;
188 // Text displayed on button
189 std::string sText;
190 // Show a border?
191 bool bHasBorder = false;
192 // Show a background?
193 bool bHasBackground = false;
194 // Where should the text be positioned?
195 enum class Alignment
196 {Left, Centre, Right} nAlign = Alignment::Centre;
197
198 public: // BaseControl overrides
199 void Update(olc::PixelGameEngine* pge) override;
200 void Draw(olc::PixelGameEngine* pge) override;
201 void DrawDecal(olc::PixelGameEngine* pge) override;
202 };
203
204 class TextBox : public Label
205 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected