able to click with cursor, button detect clicking event

This commit is contained in:
Remco
2016-06-20 13:29:28 +02:00
parent 1ec3c8f346
commit 2e50d11e07
5 changed files with 33 additions and 2 deletions
+4
View File
@@ -2,6 +2,7 @@
#include <string>
#include "Util.h"
#include "Vector.h"
#include "Cursor.h"
Button::Button(const std::string & text, Vec2f position, float width, float height) : Text(text,position)
{
@@ -51,6 +52,9 @@ void Button::update(int x, int y)
alfa = 1.0f;
else
alfa = 0.5f;
if (cursorOnButton && Cursor::getInstance()->clicked)
this->setColor(Vec3f(0, 255, 0));
}
void Button::setForeground(Vec3f color)