Added Over and Out options on text buttons
This commit is contained in:
@@ -6,9 +6,18 @@ Color4 textColor;
|
|||||||
Color4 textOutlineColor;
|
Color4 textOutlineColor;
|
||||||
Color4 boxColor;
|
Color4 boxColor;
|
||||||
Color4 boxOutlineColor;
|
Color4 boxOutlineColor;
|
||||||
|
Color4 textColorOvr;
|
||||||
|
Color4 textOutlineColorOvr;
|
||||||
|
Color4 boxColorOvr;
|
||||||
|
Color4 boxOutlineColorOvr;
|
||||||
|
Color4 textColorDn;
|
||||||
|
Color4 textOutlineColorDn;
|
||||||
|
Color4 boxColorDn;
|
||||||
|
Color4 boxOutlineColorDn;
|
||||||
bool centeredWithinBox;
|
bool centeredWithinBox;
|
||||||
std::string title;
|
std::string title;
|
||||||
G3D::GFontRef font;
|
G3D::GFontRef font;
|
||||||
|
int textSize;
|
||||||
|
|
||||||
|
|
||||||
TextButtonInstance::TextButtonInstance(void)
|
TextButtonInstance::TextButtonInstance(void)
|
||||||
@@ -22,6 +31,8 @@ TextButtonInstance::TextButtonInstance(void)
|
|||||||
textOutlineColor = Color4(0, 0, 0, 0);
|
textOutlineColor = Color4(0, 0, 0, 0);
|
||||||
boxColor = Color4(0.6F,0.6F,0.6F,0.4F);
|
boxColor = Color4(0.6F,0.6F,0.6F,0.4F);
|
||||||
boxOutlineColor = Color4(0, 0, 0, 0);
|
boxOutlineColor = Color4(0, 0, 0, 0);
|
||||||
|
textSize = 12;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextButtonInstance::~TextButtonInstance(void)
|
TextButtonInstance::~TextButtonInstance(void)
|
||||||
|
|||||||
@@ -10,6 +10,19 @@ public:
|
|||||||
Vector2 boxBegin;
|
Vector2 boxBegin;
|
||||||
Vector2 boxEnd;
|
Vector2 boxEnd;
|
||||||
Vector2 fontLocationRelativeTo;
|
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;
|
bool centeredWithinBox;
|
||||||
std::string title;
|
std::string title;
|
||||||
|
G3D::GFontRef font;
|
||||||
};
|
};
|
||||||
|
|||||||
9
main.cpp
9
main.cpp
@@ -235,6 +235,11 @@ void Demo::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void readMouseGUIInput()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Demo::onUserInput(UserInput* ui) {
|
void Demo::onUserInput(UserInput* ui) {
|
||||||
if (ui->keyPressed(SDLK_ESCAPE)) {
|
if (ui->keyPressed(SDLK_ESCAPE)) {
|
||||||
// Even when we aren't in debug mode, quit on 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]);
|
message = "FPS has been set to " + Convert(FPSVal[index]);
|
||||||
setDesiredFrameRate(FPSVal[index]);
|
setDesiredFrameRate(FPSVal[index]);
|
||||||
}
|
}
|
||||||
|
readMouseGUIInput();
|
||||||
// Add other key handling here
|
// Add other key handling here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string ExePath() {
|
std::string ExePath() {
|
||||||
char buffer[MAX_PATH];
|
char buffer[MAX_PATH];
|
||||||
GetModuleFileName( NULL, buffer, MAX_PATH );
|
GetModuleFileName( NULL, buffer, MAX_PATH );
|
||||||
|
|||||||
Reference in New Issue
Block a user