Added Over and Out options on text buttons

This commit is contained in:
andreja6
2018-04-13 14:14:35 -07:00
parent 21684a6ea3
commit 7d623bb99d
3 changed files with 32 additions and 1 deletions

View File

@@ -6,9 +6,18 @@ Color4 textColor;
Color4 textOutlineColor;
Color4 boxColor;
Color4 boxOutlineColor;
Color4 textColorOvr;
Color4 textOutlineColorOvr;
Color4 boxColorOvr;
Color4 boxOutlineColorOvr;
Color4 textColorDn;
Color4 textOutlineColorDn;
Color4 boxColorDn;
Color4 boxOutlineColorDn;
bool centeredWithinBox;
std::string title;
G3D::GFontRef font;
int textSize;
TextButtonInstance::TextButtonInstance(void)
@@ -22,6 +31,8 @@ TextButtonInstance::TextButtonInstance(void)
textOutlineColor = Color4(0, 0, 0, 0);
boxColor = Color4(0.6F,0.6F,0.6F,0.4F);
boxOutlineColor = Color4(0, 0, 0, 0);
textSize = 12;
}
TextButtonInstance::~TextButtonInstance(void)

View File

@@ -10,6 +10,19 @@ public:
Vector2 boxBegin;
Vector2 boxEnd;
Vector2 fontLocationRelativeTo;
Color4 textColor;
Color4 textOutlineColor;
Color4 boxColor;
Color4 boxOutlineColor;
Color4 textColorOvr;
Color4 textOutlineColorOvr;
Color4 boxColorOvr;
Color4 boxOutlineColorOvr;
Color4 textColorDn;
Color4 textOutlineColorDn;
Color4 boxColorDn;
Color4 boxOutlineColorDn;
bool centeredWithinBox;
std::string title;
G3D::GFontRef font;
};

View File

@@ -235,6 +235,11 @@ void Demo::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
}
void readMouseGUIInput()
{
}
void Demo::onUserInput(UserInput* ui) {
if (ui->keyPressed(SDLK_ESCAPE)) {
// Even when we aren't in debug mode, quit on escape.
@@ -299,10 +304,12 @@ void Demo::onUserInput(UserInput* ui) {
message = "FPS has been set to " + Convert(FPSVal[index]);
setDesiredFrameRate(FPSVal[index]);
}
readMouseGUIInput();
// Add other key handling here
}
std::string ExePath() {
char buffer[MAX_PATH];
GetModuleFileName( NULL, buffer, MAX_PATH );