2013-06-19 01:12:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
|
|
|
|
class SliderComponent : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2013-06-19 21:02:42 +00:00
|
|
|
//Minimum value (far left of the slider), maximum value (far right of the slider), increment size (how much just pressing L/R moves by).
|
|
|
|
SliderComponent(Window* window, float min, float max, float increment);
|
2013-06-19 01:12:30 +00:00
|
|
|
|
|
|
|
void setValue(float val);
|
|
|
|
float getValue();
|
|
|
|
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
void update(int deltaTime) override;
|
|
|
|
void onRender() override;
|
|
|
|
|
|
|
|
void setSize(Vector2u size);
|
|
|
|
|
|
|
|
private:
|
|
|
|
float mMin, mMax;
|
|
|
|
float mValue;
|
2013-06-19 21:02:42 +00:00
|
|
|
float mIncrement;
|
2013-06-19 01:12:30 +00:00
|
|
|
float mMoveScale;
|
2013-06-19 21:02:42 +00:00
|
|
|
int mRepeatWaitTimer;
|
2013-06-19 01:12:30 +00:00
|
|
|
|
|
|
|
float mMoveRate;
|
|
|
|
};
|