Added mouse click functions to image button

Added destructor for images
Deleting listener now on exit
This commit is contained in:
andreja6
2018-04-24 12:39:53 -07:00
parent 9ffe37c21a
commit d1a1ebd016
11 changed files with 121 additions and 52 deletions

View File

@@ -1,20 +1,34 @@
#include "BaseButtonInstance.h"
bool floatBottom;
bool floatRight;
bool floatCenter;
bool disabled;
bool floatBottom = false;
bool floatRight = false;
bool floatCenter = false;
bool disabled = false;
ButtonListener* listener = NULL;
BaseButtonInstance::BaseButtonInstance(void)
{
listener = NULL;
}
BaseButtonInstance::~BaseButtonInstance(void)
{
delete listener;
}
void BaseButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown){}
bool BaseButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd){return false;}
void BaseButtonInstance::onMouseClick()
{
if(listener != NULL)
{
listener->onButton1MouseClick(this);
}
}
bool BaseButtonInstance::mouseInArea(float point1x, float point1y, float point2x, float point2y, float mousex, float mousey)
{