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

Class Slider

extensions/olcPGEX_QuickGUI.h:300–327  ·  view source on GitHub ↗

Creates a Slider Control - a grabbable handle that slides between two locations

Source from the content-addressed store, hash-verified

298
299 // Creates a Slider Control - a grabbable handle that slides between two locations
300 class Slider : public BaseControl
301 {
302 public:
303 Slider(olc::QuickGUI::Manager& manager, // Associate with a Manager
304 const olc::vf2d& posmin, // Screen location of "minimum"
305 const olc::vf2d& posmax, // Screen location of "maximum"
306 const float valmin, // Value of minimum
307 const float valmax, // Value of maximum
308 const float value); // Starting value
309
310 public:
311 // Minium value
312 float fMin = -100.0f;
313 // Maximum value
314 float fMax = +100.0f;
315 // Current value
316 float fValue = 0.0f;
317
318 // Location of minimum/start
319 olc::vf2d vPosMin;
320 // Location of maximum/end
321 olc::vf2d vPosMax;
322
323 public: // BaseControl overrides
324 void Update(olc::PixelGameEngine* pge) override;
325 void Draw(olc::PixelGameEngine* pge) override;
326 void DrawDecal(olc::PixelGameEngine* pge) override;
327 };
328
329
330 class ListBox : public BaseControl

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected