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

Class Button

extensions/olcPGEX_QuickGUI.h:223–243  ·  view source on GitHub ↗

Creates a Button Control - a clickable, labelled rectangle

Source from the content-addressed store, hash-verified

221
222 // Creates a Button Control - a clickable, labelled rectangle
223 class Button : public BaseControl
224 {
225 public:
226 Button(olc::QuickGUI::Manager& manager, // Associate with a Manager
227 const std::string& text, // Text to display
228 const olc::vf2d& pos, // Location of button top-left
229 const olc::vf2d& size); // Size of button
230
231 public:
232 // Position of button
233 olc::vf2d vPos;
234 // Size of button
235 olc::vf2d vSize;
236 // Text displayed on button
237 std::string sText;
238
239 public: // BaseControl overrides
240 void Update(olc::PixelGameEngine* pge) override;
241 void Draw(olc::PixelGameEngine* pge) override;
242 void DrawDecal(olc::PixelGameEngine* pge) override;
243 };
244
245 // Creates a Button Control - a clickable, labelled rectangle
246 class CheckBox : public Button

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected