本文整理汇总了C++中MainMenu::displayFlower方法的典型用法代码示例。如果您正苦于以下问题:C++ MainMenu::displayFlower方法的具体用法?C++ MainMenu::displayFlower怎么用?C++ MainMenu::displayFlower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainMenu
的用法示例。
在下文中一共展示了MainMenu::displayFlower方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFrame
void createFrame() {
if (stage == "INIT") { //loading stage
if (loader.loadResources() != 0) {
MessageBox(NULL, L"Forget-Me-Not was not installed correctly, as files are missing.", L"Error.", NULL);
exit(0);
}
else {
mainMenu.init(&window, loader);
stage = "MENU";
}
}
else if (stage == "MENU") { //menu stage
mainMenu.getInput(mouseX, mouseY, mouseDown, framesDisplayed, processingStrokes);
if (framesDisplayed == 30) { //triggers starting music
loader.starting_music.play();
}
if (framesDisplayed < 340) { //flower start animation
//framesDisplayed = 340; //REMOVE THIS LINE LATER (just to skip flower)
mainMenu.displayFlower();
}
else{ //actual menu
int isDisplay = mainMenu.display();
if (isDisplay == 1) {
currPatient = mainMenu.getPatient();
stage = "OPTIONS";
}
}
}
else if (stage == "OPTIONS") {
sf::Text menutitle;
menutitle.setFont(loader.bold_font);
menutitle.setCharacterSize(75);
menutitle.setString("Forget-Me-Not");
menutitle.setPosition(sf::Vector2f(280, 10));
menutitle.setColor(sf::Color(0, 0, 0, 255));
window.draw(menutitle);
sf::Text menusubtitle;
menusubtitle.setFont(loader.regular_font);
menusubtitle.setCharacterSize(24);
menusubtitle.setString("Loaded patient " + currPatient.firstName + " " + currPatient.lastName);
menusubtitle.setPosition(sf::Vector2f(300, 100));
menusubtitle.setColor(sf::Color(0, 0, 0, 255));
window.draw(menusubtitle);
int choice = 0;
sf::RectangleShape rect;
rect.setSize(sf::Vector2f(450, 620));
if (mouseX > 30 && mouseX < 480 && mouseY > 160 && mouseY < 780) {
rect.setFillColor(sf::Color(255, 150, 150, 255));
if (mouseDown) {
rect.setFillColor(sf::Color(120, 60, 60, 255));
choice = 1;
}
}
else {
rect.setFillColor(sf::Color(255, 120, 120, 255));
}
rect.setPosition(sf::Vector2f(30, 160));
window.draw(rect);
sf::Text text;
text.setString("START NEW TEST");
text.setPosition(sf::Vector2f(50, 420));
text.setCharacterSize(44);
text.setColor(sf::Color(255, 255, 255, 255));
text.setFont(loader.bold_font);
window.draw(text);
sf::RectangleShape rect2;
rect2.setSize(sf::Vector2f(450, 620));
if (mouseX > 515 && mouseX < 965 && mouseY > 160 && mouseY < 780) {
rect2.setFillColor(sf::Color(130, 200, 130, 255));
if (mouseDown) {
rect2.setFillColor(sf::Color(60, 100, 60, 255));
choice = 2;
}
}
else {
rect2.setFillColor(sf::Color(100, 200, 100, 255));
}
rect2.setPosition(sf::Vector2f(515, 160));
window.draw(rect2);
sf::Text text2;
text2.setString("VIEW PATIENT RESULTS");
text2.setPosition(sf::Vector2f(550, 420));
text2.setCharacterSize(44);
text2.setColor(sf::Color(255, 255, 255, 255));
text2.setFont(loader.bold_font);
window.draw(text2);
if (choice == 1) {
stage = "GAME";
}
}
else if (stage == "GAME") {
//.........这里部分代码省略.........