2013-09-23 19:58:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
#include "../resources/TextureResource.h"
|
|
|
|
|
|
|
|
class RatingComponent : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RatingComponent(Window* window);
|
|
|
|
|
|
|
|
std::string getValue() const override;
|
|
|
|
void setValue(const std::string& value) override;
|
|
|
|
|
2013-09-24 19:44:18 +00:00
|
|
|
bool input(InputConfig* config, Input input) override;
|
2013-09-23 19:58:28 +00:00
|
|
|
void render(const Eigen::Affine3f& parentTrans);
|
|
|
|
|
|
|
|
void onSizeChanged() override;
|
|
|
|
private:
|
|
|
|
void updateVertices();
|
|
|
|
|
|
|
|
float mValue;
|
|
|
|
|
|
|
|
struct Vertex
|
|
|
|
{
|
|
|
|
Eigen::Vector2f pos;
|
|
|
|
Eigen::Vector2f tex;
|
|
|
|
} mVertices[12];
|
|
|
|
|
|
|
|
std::shared_ptr<TextureResource> mFilledTexture;
|
|
|
|
std::shared_ptr<TextureResource> mUnfilledTexture;
|
|
|
|
};
|
|
|
|
|