本文整理汇总了C++中ogre::Overlay::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ Overlay::hide方法的具体用法?C++ Overlay::hide怎么用?C++ Overlay::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Overlay
的用法示例。
在下文中一共展示了Overlay::hide方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleInput
void PendulumTest::handleInput(opal::real elapsedRealTime,
const SimulationEngine& engine)
{
OIS::Keyboard* keyboard = engine.getKeyboard();
// This variable can be used to keep keys from repeating too fast.
static Ogre::Real toggleTimer = 0;
if (toggleTimer >= 0)
{
toggleTimer -= elapsedRealTime;
}
// Toggle GUI.
if (keyboard->isKeyDown(OIS::KC_G) && toggleTimer <= 0)
{
Ogre::Overlay* debugOverlay = Ogre::OverlayManager::getSingleton().
getByName("Verve/TrialNumber");
if (debugOverlay->isVisible())
{
debugOverlay->hide();
mAgentDebugger->setDisplayEnabled(false);
}
else
{
debugOverlay->show();
mAgentDebugger->setDisplayEnabled(true);
}
toggleTimer = 0.5;
}
}
示例2: showDebugOverlay
void FrameListener::showDebugOverlay(bool show) {
Ogre::Overlay *overlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay");
if (show)
overlay->show();
else
overlay->hide();
}
示例3: fade
void fade(Ogre::Real tpf) {
if (m_eFadeOperation != FADE_NONE && m_pTextUnitState) {
m_pTextUnitState->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_TEXTURE, m_fAlpha);
if (m_eFadeOperation == FADE_IN) {
m_fCurrentDuration -= tpf;
m_fAlpha = m_fCurrentDuration / m_fTotalDuration;
if (m_fAlpha < 0.0) {
m_pOverlay->hide();
m_eFadeOperation = FADE_NONE;
if (m_pFaderCallback) {
m_pFaderCallback->fadeInCallback();
}
}
}
else if (m_eFadeOperation == FADE_OUT) {
m_fCurrentDuration += tpf;
m_fAlpha = m_fCurrentDuration / m_fTotalDuration;
if (m_fAlpha > 1.0) {
m_eFadeOperation = FADE_NONE;
if (m_pFaderCallback) {
m_pFaderCallback->fadeOutCallback();
}
}
}
}
#ifdef USE_SPRITE_SHADER
m_SpritePixelShaderParameters->setNamedConstant("colour", Ogre::ColourValue(1, 1, 1, m_fAlpha));
#endif
}
示例4: setVisible
void setVisible(bool bShow) {
if (bShow) {
m_pOverlay->show();
}
else {
m_pOverlay->hide();
}
}
示例5: hideDialogue
void Menu::hideDialogue()
{
Ogre::OverlayManager* olMgr =Ogre::OverlayManager::getSingletonPtr();
/*If overlay manager is NULL, then it is not present any more and all overlays
should already be destroyed at that point. So we can return anyway. */
if (olMgr==NULL) return;
Ogre::Overlay* ol = olMgr->getByName(cDialogueOverlay);
if (ol!=NULL)
{
ol->hide();
}
}
示例6: exit
void MenuState::exit ()
{
// delete _fader;
// musica del menu STOP
IntroState::getSingleton().getMenuTrackPtr()->stop();
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().hide();
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->hide();
Ogre::Overlay *overlay = _overlayManager->getByName("Menu");
overlay->hide();
_sceneMgr->clearScene();
_root->getAutoCreatedWindow()->removeAllViewports();
}
示例7: init
void init() {
Ogre::MaterialPtr matptr = Ogre::MaterialManager::getSingleton().getByName("FadeMaterial");
#ifdef USE_SPRITE_SHADER
CShaderManager::getSingleton().addAlphaBlendTextureShader(matptr);
Ogre::Pass *pPass = matptr->getTechnique(0)->getPass(0);
m_SpritePixelShaderParameters = pPass->getFragmentProgram()->createParameters();
m_SpriteVertexShaderParameters = pPass->getVertexProgram()->createParameters();
pPass->setFragmentProgramParameters(m_SpritePixelShaderParameters);
pPass->setVertexProgramParameters(m_SpriteVertexShaderParameters);
#endif
m_pTextUnitState = matptr->getTechnique(0)->getPass(0)->getTextureUnitState(0);
m_pOverlay = Ogre::OverlayManager::getSingleton().getByName("FadeOverlay");
m_pOverlay->hide();
}
示例8: CAlphaFader
CAlphaFader(CFaderCallback *pCallback = NULL)
:
m_fAlpha(0),
m_fCurrentDuration(0),
m_fTotalDuration(0),
m_pFaderCallback(pCallback),
m_eFadeOperation(FADE_NONE) {
Ogre::MaterialPtr matptr = Ogre::MaterialManager::getSingleton().getByName("FadeMaterial");
#ifdef USE_SPRITE_SHADER
CShaderManager::getSingleton().addAlphaBlendTextureShader(matptr);
Ogre::Pass *pPass = matptr->getTechnique(0)->getPass(0);
m_SpritePixelShaderParameters = pPass->getFragmentProgram()->createParameters();
m_SpriteVertexShaderParameters = pPass->getVertexProgram()->createParameters();
pPass->setFragmentProgramParameters(m_SpritePixelShaderParameters);
pPass->setVertexProgramParameters(m_SpriteVertexShaderParameters);
#endif
m_pTextUnitState = matptr->getTechnique(0)->getPass(0)->getTextureUnitState(0);
m_pOverlay = Ogre::OverlayManager::getSingleton().getByName("FadeOverlay");
m_pOverlay->hide();
}
示例9: handleInput
void handleInput(Ogre::Real elapsedRealTime)
{
// This variable can be used to keep keys from repeating too fast.
static Ogre::Real toggleTimer = 0;
if (toggleTimer >= 0)
{
toggleTimer -= elapsedRealTime;
}
OIS::Keyboard* keyboard = gEngine.getKeyboard();
if (keyboard->isKeyDown(OIS::KC_W))
{
gCar->forward();
}
else if (keyboard->isKeyDown(OIS::KC_S))
{
gCar->reverse();
}
else
{
gCar->idle();
}
if (keyboard->isKeyDown(OIS::KC_A))
{
gCar->setSteering(-1);
}
else if (keyboard->isKeyDown(OIS::KC_D))
{
gCar->setSteering(1);
}
else
{
gCar->setSteering(0);
}
// If available, get data from the game controller.
if (gGamePad)
{
// Update the game controller state.
SDL_JoystickUpdate();
Ogre::Real joy0X = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 0) /
(Ogre::Real)32768;
Ogre::Real joy0Y = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 1) /
(Ogre::Real)32768;
Ogre::Real joy1X = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 4) /
(Ogre::Real)32768;
Ogre::Real joy1Y = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 3) /
(Ogre::Real)32768;
if (fabs(joy0Y) > 0.1)
{
gCar->setThrottle(-joy0Y);
}
else
{
gCar->idle();
}
if (fabs(joy0X) > 0.1)
{
gCar->setSteering(joy0X);
}
else
{
gCar->setSteering(0);
}
if (joy1X > 0.2 || joy1X < -0.2)
{
Ogre::Degree rotAroundY = -Ogre::Degree(joy1X);
gEngine.getCamera()->yawRelative(rotAroundY.valueDegrees());
}
if (joy1Y > 0.2 || joy1Y < -0.2)
{
Ogre::Degree rotAroundX = -Ogre::Degree(joy1Y);
gEngine.getCamera()->pitchRelative(rotAroundX.valueDegrees());
}
}
// Toggle GUI.
if (keyboard->isKeyDown(OIS::KC_G) && toggleTimer <= 0)
{
Ogre::Overlay* debugOverlay = Ogre::OverlayManager::getSingleton().
getByName("Verve/Debug");
if (debugOverlay->isVisible())
{
debugOverlay->hide();
gAgentDebugger->setDisplayEnabled(false);
}
else
{
debugOverlay->show();
gAgentDebugger->setDisplayEnabled(true);
}
//.........这里部分代码省略.........