2012-02-11 10:08:59 -06:00
|
|
|
/*
|
|
|
|
* 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)
|
|
|
|
{
|
2012-04-21 16:46:37 -05:00
|
|
|
//g->drawblob(baseX+(sin(cValue+t)*(Size.X/2)), baseY+(cos(cValue+t)*(Size.X/2)), t*255, t*255, t*255);
|
2012-02-11 10:08:59 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Spinner::~Spinner()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|