mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
44 lines
854 B
C++
44 lines
854 B
C++
#include "stdafx.h"
|
|
|
|
#include "V8DataModel/ImageButton.h"
|
|
|
|
namespace RBX {
|
|
|
|
const char* const sGuiImageButton = "ImageButton";
|
|
|
|
|
|
GuiImageButton::GuiImageButton()
|
|
: DescribedCreatable<GuiImageButton,GuiButton,sGuiImageButton>("ImageButton")
|
|
, GuiImageMixin()
|
|
, imageState(GuiDrawImage::ALL)
|
|
{}
|
|
|
|
GuiImageButton::GuiImageButton(Verb* theVerb) : DescribedCreatable<GuiImageButton,GuiButton,sGuiImageButton>("ImageButton")
|
|
, GuiImageMixin()
|
|
, imageState(GuiDrawImage::ALL)
|
|
{
|
|
verb = theVerb;
|
|
}
|
|
|
|
IMPLEMENT_GUI_IMAGE_MIXIN(GuiImageButton);
|
|
|
|
void GuiImageButton::render2d(Adorn* adorn)
|
|
{
|
|
//Render the background
|
|
Rect2D rect;
|
|
render2dButtonImpl(adorn, rect);
|
|
|
|
Gui::WidgetState oldGuiState = guiState;
|
|
if (verb && verb->isSelected())
|
|
{
|
|
guiState = Gui::DOWN_OVER;
|
|
active = verb->isEnabled();
|
|
}
|
|
|
|
renderImage(adorn);
|
|
|
|
guiState = oldGuiState;
|
|
}
|
|
|
|
}
|