本文整理汇总了C++中Levels::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Levels::draw方法的具体用法?C++ Levels::draw怎么用?C++ Levels::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Levels
的用法示例。
在下文中一共展示了Levels::draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
else if(state == Options)
{
state = prevState;
prevState = Options;
}
else if(state == Paused)
{
state = prevState;
prevState = Paused;
}
}
if(event.Key.Code == sf::Key::Space)
{
for(int i = 0; i < ice.size(); i++)
{
if(ice[i]->state != Ice::IceState::Rock)
{
ice[i]->state = Ice::IceState::Reg;
}
}
}
break;
case sf::Event::MouseButtonReleased:
if(event.MouseButton.Button == sf::Mouse::Button::Left)
{
if(state == Menu)
{
if(play.contains(mouse))
{
state = Ingame;
}
else if(options.contains(mouse))
{
state = Options;
prevState = Menu;
}
else if(quit.contains(mouse))
{
WINDOW.Close();
}
}
else if(state == Paused)
{
if(resume.contains(mouse))
{
state = Ingame;
}
else if(pauseOptions.contains(mouse))
{
state = Options;
prevState = Paused;
}
else if(quitToMenu.contains(mouse))
{
state = Menu;
prevState = Paused;
}
}
}
break;
}
}
WINDOW.Clear(sf::Color(80, 80, 80, 0));
/* DRAWING CODE */
if(state == Ingame)
{
/* Tiles */
levels->draw(currentLevel, WINDOW);
/* HUD Elements */
str.Draw(WINDOW);
}
else if(state == Menu)
{
play.Draw(WINDOW);
options.Draw(WINDOW);
quit.Draw(WINDOW);
play.Update(mouse);
options.Update(mouse);
quit.Update(mouse);
}
else if(state == Options)
{
}
else if(state == Paused)
{
resume.Draw(WINDOW);
pauseOptions.Draw(WINDOW);
quitToMenu.Draw(WINDOW);
resume.Update(mouse);
pauseOptions.Update(mouse);
quitToMenu.Update(mouse);
}
/* END OF DRAWING */
WINDOW.Display();
}
return EXIT_SUCCESS;
}