Added selected in button class

Basically active, it will probably be renamed
This commit is contained in:
andreja6
2018-04-25 14:34:27 -07:00
parent 10f3a25c54
commit 827e610b8c
5 changed files with 44 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ ImageButtonInstance::~ImageButtonInstance(void)
image_dn = NULL;
delete listener;
listener = NULL;
selected = false;
}
bool ImageButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
@@ -93,7 +94,11 @@ void ImageButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouse
positionRelative = Vector2(rd->getWidth() + position.x, position.y);
}
int renderimage = openGLID;
if(disabled)
if(selected == true && !image_dn.isNull())
{
renderimage = openGLID_dn;
}
else if(disabled)
{
if(!image_ds.isNull())
renderimage = openGLID_ds;