diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-11 16:08:59 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-11 16:08:59 (GMT) |
| commit | 9f7b06ff47e12076a261b6a209b27c558741eb8a (patch) | |
| tree | d0b4c8f53d976b1e2c1d771da47d7a9e4517db4d /src/interface/Spinner.cpp | |
| parent | 54741c79ef6169eda47745ea4f13e4e1d9982497 (diff) | |
| download | powder-9f7b06ff47e12076a261b6a209b27c558741eb8a.zip powder-9f7b06ff47e12076a261b6a209b27c558741eb8a.tar.gz | |
Comments on save preview and some minor changes for vote bars
Diffstat (limited to 'src/interface/Spinner.cpp')
| -rw-r--r-- | src/interface/Spinner.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/interface/Spinner.cpp b/src/interface/Spinner.cpp new file mode 100644 index 0000000..1ecad8d --- /dev/null +++ b/src/interface/Spinner.cpp @@ -0,0 +1,36 @@ +/* + * Spinner.cpp + * + * Created on: Feb 11, 2012 + * Author: Simon + */ + + +#include <math.h> +#include <iostream> +#include "Spinner.h" + +using namespace ui; + +Spinner::Spinner(Point position, Point size): + Component(position, size), cValue(0) +{ +} +void Spinner::Tick(float dt) +{ + cValue += 0.05f; +} +void Spinner::Draw(const Point& screenPos) +{ + Graphics * g = ui::Engine::Ref().g; + int baseX = screenPos.X+(Size.X/2); + int baseY = screenPos.Y+(Size.Y/2); + for(float t = 0.0f; t < 1.0f; t+=0.05f) + { + g->drawblob(baseX+(sin(cValue+t)*(Size.X/2)), baseY+(cos(cValue+t)*(Size.X/2)), t*255, t*255, t*255); + } +} +Spinner::~Spinner() +{ + +} |
