本文整理汇总了C++中Hud::showHud方法的典型用法代码示例。如果您正苦于以下问题:C++ Hud::showHud方法的具体用法?C++ Hud::showHud怎么用?C++ Hud::showHud使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hud
的用法示例。
在下文中一共展示了Hud::showHud方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IndieLib
int IndieLib()
{
// ----- IndieLib intialization -----
CIndieLib *mI = CIndieLib::instance();
if (!mI->init()) return 0;
// ----- Get Window Dimensions
int winWidth = mI->_window->getWidth();
int winHeight = mI->_window->getHeight();
srand(static_cast<unsigned int>(time(0)));
// ----- Surface loading -----
IND_Surface *mSurfaceBack = IND_Surface::newSurface();
if (!mI->_surfaceManager->add(mSurfaceBack, "../SpaceGame/resources/Backgrounds/18.jpg", IND_OPAQUE, IND_32)) return 0;
/*IND_Animation* mTestA = IND_Animation::newAnimation();
if (!mI->_animationManager->addToSurface(mTestA, "resources/animations/dust.xml", IND_ALPHA, IND_32, 255, 0, 255)) return 0;
mTestA->getActualFramePos(0);*/
// Loading 2D Entities
// Background
IND_Entity2d* mBack = IND_Entity2d::newEntity2d();
mI->_entity2dManager->add(mBack);
mBack->setSurface(mSurfaceBack);
mBack->setScale((float)winWidth / mSurfaceBack->getWidth(), (float)winHeight / mSurfaceBack->getHeight());
Controls* controls = new Controls();
controls->loadSettings();
ErrorHandler* error = new ErrorHandler();
error->initialize(mI);
Hud* mHud = new Hud();
mHud->createHud(mI);
Menu* mMenu = new Menu();
mMenu->createMenu(mI);
Save* quickSave = new Save();
if (!SoundEngine::initialize())
{
error->writeError(200, 100, "Error", "SoundEngine");
}
vector<Planet*> mPlanets;
Ship* mShip = NULL;
bool loadSave = false;
float mDelta = 0.0f;
IND_Timer* mTimer = new IND_Timer;
mTimer->start();
while (!mI->_input->onKeyPress(IND_ESCAPE) && !mI->_input->quit() && !mMenu->isExit())
{
// get delta time
mDelta = mI->_render->getFrameTime() / 1000.0f;
if (mI->_input->isKeyPressed(controls->getMenu()))
{
mMenu->show();
SoundEngine::getSoundEngine()->setAllSoundsPaused(true);
}
if (!mMenu->isHidden())
{
mMenu->updateMenu(mHud, quickSave, mPlanets, mShip);
loadSave = mHud->getLoadingText()->isShow();
}
else
{
if (loadSave)
{
mDelta = 0.0;
loadSave = false;
SoundEngine::getSoundEngine()->setAllSoundsPaused(true);
mHud->getLoadingText()->setShow(false);
quickSave->loadSave(mI, mShip, mPlanets);
mHud->showHud();
}
if (mShip != NULL)
{
if (mI->_input->onKeyPress(controls->getQuickSave()))
{
quickSave->makeSave(mI, mShip, mPlanets);
}
mHud->updateHud(mShip);
if (mI->_input->onKeyPress(controls->getQuickLoad()))
{
deleteObjects(mHud, mShip, mPlanets);
loadSave = true;
}
//.........这里部分代码省略.........