本文整理汇总了C++中ogre::Overlay::show方法的典型用法代码示例。如果您正苦于以下问题:C++ Overlay::show方法的具体用法?C++ Overlay::show怎么用?C++ Overlay::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Overlay
的用法示例。
在下文中一共展示了Overlay::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createOverlay
// create overlay uv test
void Test::createOverlay(void)
{
// load the fade
mFader = 0;
Ogre::MaterialPtr mFaderMaterial;
Ogre::TextureUnitState *mTexture = 0;
Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
mFader = static_cast<Ogre::PanelOverlayElement*>(
overlayManager.createOverlayElement("Panel", "Fader"));
mFader->setMetricsMode(Ogre::GMM_RELATIVE);
mFader->setPosition(0, 0);
mFader->setDimensions(0.25f, 0.25f);
mFader->setMaterialName("BotonTest"); // Optional background material
// Ensures that the material exists
mFader->setUV(0,0,0.5,1);
// show the fade
mFader->show();
// Create an overlay, and add the panel
Ogre::Overlay *mOverlay = 0;
mOverlay = overlayManager.create("FaderOverlay");
mOverlay->add2D(mFader);
mOverlay->show();
}
示例2: 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;
}
}
示例3: showDebugOverlay
void FrameListener::showDebugOverlay(bool show) {
Ogre::Overlay *overlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay");
if (show)
overlay->show();
else
overlay->hide();
}
示例4: createTextArea
// Create text area for SkyX parameters
void createTextArea()
{
// Create a panel
Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*>(
OverlayManager::getSingleton().createOverlayElement("Panel", "SkyXParametersPanel"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setPosition(10, 10);
panel->setDimensions(400, 400);
// Create a text area
mTextArea = static_cast<Ogre::TextAreaOverlayElement*>(
OverlayManager::getSingleton().createOverlayElement("TextArea", "SkyXParametersTextArea"));
mTextArea->setMetricsMode(Ogre::GMM_PIXELS);
mTextArea->setPosition(0, 0);
mTextArea->setDimensions(100, 100);
mTextArea->setCaption("SkyX plugin demo");
mTextArea->setCharHeight(16);
mTextArea->setFontName("BlueHighway");
mTextArea->setColourBottom(ColourValue(0.3, 0.5, 0.3));
mTextArea->setColourTop(ColourValue(0.5, 0.7, 0.5));
// Create an overlay, and add the panel
Ogre::Overlay* overlay = OverlayManager::getSingleton().create("OverlayName");
overlay->add2D(panel);
// Add the text area to the panel
panel->addChild(mTextArea);
// Show the overlay
overlay->show();
}
示例5: setVisible
void setVisible(bool bShow) {
if (bShow) {
m_pOverlay->show();
}
else {
m_pOverlay->hide();
}
}
示例6: showDialogue
void Menu::showDialogue(const std::string& first, const std::vector<std::string>& options)
{
Ogre::OverlayManager& om = Ogre::OverlayManager::getSingleton();
std::cout << "getByName(overlay)\n";
Ogre::Overlay* dialOverlay = om.getByName(cDialogueOverlay);
if (dialOverlay == NULL)
{
std::cout << "create(overlay)\n";
dialOverlay = om.create(cDialogueOverlay);
}
Ogre::OverlayContainer* dialCont = NULL;
std::cout << "getOE(Box)\n";
dialCont = static_cast<Ogre::OverlayContainer*> (om.getOverlayElement(cDialogueOverlay+"/Box"));
if (dialCont == NULL)
{
std::cout << "createOE(Box)\n";
dialCont = static_cast<Ogre::OverlayContainer*>
(om.createOverlayElement("Panel", cDialogueOverlay+"/Box"));
dialCont->setPosition(0.0, 0.75);
dialCont->setDimensions(1.0, 0.25);
dialCont->setMaterialName("Dusk/Dialogue/Black");
}
std::cout << "getOE(Box/First)\n";
Ogre::OverlayElement* dialElem;
dialElem = om.getOverlayElement(cDialogueOverlay+"/Box/First");
if (dialElem==NULL)
{
std::cout << "createOE(Box/First)\n";
dialElem = om.createOverlayElement("TextArea", cDialogueOverlay+"/Box/First");
dialElem->setDimensions(1.0, 0.0625);
dialElem->setPosition(0.0, 0.0);
dialElem->setMaterialName("Dusk/Dialogue/Element");
dialCont->addChild(dialElem);
}
dialElem->setCaption(first);
dialElem->show();
unsigned int elemCount = options.size();
if (elemCount > cMaxDialogueOptions)
{
elemCount = cMaxDialogueOptions;
}
killDialogueOverlayLines();
unsigned int i;
const float elemHeight = 0.8/(float)elemCount;
for (i=0; i<elemCount; i=i+1)
{
//dialElem = om.createOverlayElement("TextArea", cDialogueOverlay+"/Box/Line"+IntToString(i));
dialElem = om.createOverlayElementFromTemplate(cDialogueOverlay+"/LineTemplate", "TextArea", cDialogueOverlay+"/Box/Line"+IntToString(i));
dialElem->setPosition(0.1, dialCont->getHeight()*(0.2+i*elemHeight));
dialElem->setDimensions(0.8, elemHeight*dialCont->getHeight());
dialElem->setCaption(IntToString(i+1)+": "+options[i]);
dialElem->show();
dialCont->addChild(dialElem);
m_DialogueLineCount = i+1;
}//for
dialOverlay->show();
}
示例7: createScene
void OgreApp::createScene()
{
sceneMgr->setSkyBox(true, "Sky", 5, 8, 4000);
sceneMgr->setAmbientLight(ColourValue(0.5f, 0.5f, 0.5f));
sceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
node = sceneMgr->getRootSceneNode()->createChildSceneNode("OgreHead");
ent = sceneMgr->createEntity("Ogre", "ogrehead.mesh");
node->attachObject(ent);
node->setPosition(0, 50, 0);
OgreAL::Sound *bgSound = soundManager->createSound("5.1 Test", "6chan.ogg", true);
bgSound->setGain(2);
bgSound->setRelativeToListener(true);
bgSound->play();
node = sceneMgr->getRootSceneNode()->createChildSceneNode("CameraNode");
node->setPosition(0, 100, 100);
node = node->createChildSceneNode("PitchNode");
node->attachObject(camera);
node->attachObject(soundManager->getListener());
node->pitch(Ogre::Degree(-30));
// Create a ground plane
Plane plane(Vector3::UNIT_Y, 0);
MeshManager::getSingleton().createPlane("ground",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
15000,15000,20,20,true,1,5,5,Vector3::UNIT_Z);
ent = sceneMgr->createEntity("GroundEntity", "ground");
sceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
ent->setMaterialName("Ground");
ent->setCastShadows(false);
light = sceneMgr->createLight("sun");
light->setType(Light::LT_DIRECTIONAL);
light->setDirection(-1,-1,-1);
OverlayManager& overlayMgr = OverlayManager::getSingleton();
Ogre::OverlayContainer* panel = static_cast<OverlayContainer*>(
overlayMgr.createOverlayElement("Panel", "PanelName"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setPosition(10, 10);
panel->setDimensions(100, 100);
TextAreaOverlayElement* textArea = static_cast<TextAreaOverlayElement*>(
overlayMgr.createOverlayElement("TextArea", "TextAreaName"));
textArea->setMetricsMode(Ogre::GMM_PIXELS);
textArea->setPosition(0, 0);
textArea->setDimensions(100, 100);
textArea->setCharHeight(16);
textArea->setFontName("Arial");
textArea->setCaption("Hello, World!");
Ogre::Overlay* overlay = overlayMgr.create("AverageFps");
overlay->add2D(panel);
panel->addChild(textArea);
overlay->show();
}
示例8: startFadeIn
void startFadeIn(Ogre::Real fDuration) {
if (fDuration < 0) fDuration = -fDuration;
m_fAlpha = 1.0;
m_fTotalDuration = fDuration;
m_fCurrentDuration = fDuration;
m_eFadeOperation = FADE_IN;
m_pOverlay->show();
}
示例9: createOverlay
void MenuState::createOverlay()
{
unsigned int width, height, depth;
int left, top;
Ogre::Overlay *overlay = _overlayManager->getByName("Menu");
_root->getAutoCreatedWindow()->getMetrics(width, height, depth, left, top);
overlay->setScale(((float(width) / 100) / 1024) * 100, ((float(height) / 100) / 768) * 100);
overlay->show();
// _fader->startFadeIn(0);
}
示例10: createGui
void Gui::createGui(Ogre::SceneManager* p_scene_manager, OgreBites::SdkTrayManager* p_tray_manager){
m_tray_manager = p_tray_manager;
m_button = m_tray_manager->createButton(OgreBites::TL_TOPLEFT, "MyButton", "Click me!");
if(m_button->getName() == "MyButton"){
int p = 0;
}
// Load layout
Ogre::ResourceGroupManager::getSingletonPtr();
Ogre::OverlayManager* mg = Ogre::OverlayManager::getSingletonPtr();
Ogre::Overlay* ov = mg->getByName("testOverlay");
ov->show();
}
示例11: createInput
void BasisManager::createInput() // создаем систему ввода
{
Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
mWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
mInputManager = OIS::InputManager::createInputSystem( pl );
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
mKeyboard->setEventCallback(this);
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
mMouse->setEventCallback(this);
mRoot->addFrameListener(this);
windowResized(mWindow); // инициализация
Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName("wallpaper");
if (false == material.isNull()) {
Ogre::OverlayManager & manager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay * overlay = manager.create("wallpaper");
overlay->setZOrder(0);
overlay->show();
Ogre::PanelOverlayElement * panel = static_cast<Ogre::PanelOverlayElement*>(manager.createOverlayElement("Panel", "wallpaper"));
panel->setDimensions(1, 1);
/*Ogre::FontPtr mpFont = Ogre::FontManager::getSingleton().getByName("MyGUI_font");
mpFont->load();
if (!mpFont.isNull()) {
const Ogre::MaterialPtr & material2 = mpFont->getMaterial();
panel->setMaterialName(material2->getName());
}*/
panel->setMaterialName(material->getName());
overlay->add2D(panel);
}
}
示例12: initRendering
void Game::initRendering()
{
#ifdef _DEBUG
const char* plugin_file = "plugins_d.cfg";
#else
const char* plugin_file = "plugins.cfg";
#endif
m_ogreRoot = new Ogre::Root(plugin_file);
m_ogreRoot->showConfigDialog();
m_ogreRoot->initialise(true);
m_renderWindow = m_ogreRoot->getAutoCreatedWindow(); //createRenderWindow("mkdemo", 800, 600, false);
m_ogreSceneMgr = m_ogreRoot->createSceneManager(Ogre::ST_GENERIC);
m_ogreCamera = m_ogreSceneMgr->createCamera("main_cam");
Ogre::Viewport* viewport = m_renderWindow->addViewport(m_ogreCamera);
m_ogreCamera->setAspectRatio(viewport->getActualWidth() / (float)viewport->getActualHeight());
// DebugDrawer singleton
new DebugDrawer(m_ogreSceneMgr, .75f);
loadOgreResources();
// overlay
Ogre::Overlay* hud = Ogre::OverlayManager::getSingleton().getByName("Game/HUD");
hud->show();
if (m_disableShadows)
m_ogreSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_NONE);
else
m_ogreSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);
m_ogreCamera->setNearClipDistance(0.1f);
if (!m_startWithFreelook)
m_playerCam = new CameraTPP(m_ogreCamera, NULL);
else
m_playerCam = new CameraFPP(m_ogreCamera, NULL);
m_ogreSceneMgr->setAmbientLight(Ogre::ColourValue(0.3f, 0.3f, 0.3f)); // please note it's usually changed on level deserialization with RenderSettingsSetter
}
示例13: createCanvasOverlay
void OgreAppLogic::createCanvasOverlay()
{
//create Texture
mTexture = new Ogre::Canvas::Texture("Canvas", 640, 480, true, 0);
//create Material
mTexture->createMaterial();
//create Overlay
Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay* overlay = overlayManager.create("Canvas/Overlay");
mPanel = static_cast<Ogre::PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "Canvas/Panel"));
mPanel->setMetricsMode(Ogre::GMM_PIXELS);
mPanel->setMaterialName("Canvas");
mPanel->setDimensions(640, 480);
mPanel->setPosition(0, 0);
overlay->add2D(mPanel);
overlay->show();
}
示例14: createCanvasOverlay
void OgreAppLogic::createCanvasOverlay()
{
Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay* overlay = overlayManager.create("Canvas/Overlay");
Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "CanvasClock1/Panel"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setMaterialName("CanvasClock1");
panel->setDimensions(150.0f, 150.0f);
panel->setPosition(0, 0);
overlay->add2D(panel);
panel = static_cast<Ogre::PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "CanvasClock2/Panel"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setMaterialName("CanvasClock2");
panel->setDimensions(150.0f, 150.0f);
panel->setPosition(mApplication->getRenderWindow()->getWidth()-150.0f, 0);
overlay->add2D(panel);
overlay->show();
}
示例15: createBrowser
void SalamancerApplication::createBrowser(){
Ogre::TexturePtr renderTexture = Ogre::TextureManager::getSingleton().createManual(
"texture",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, mWindow->getWidth(), mWindow->getHeight(), 0, Ogre::PF_A8R8G8B8, Ogre::TU_WRITE_ONLY);
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingletonPtr()->create("BrowserMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
material->getTechnique(0)->getPass(0)->setCullingMode(Ogre::CULL_CLOCKWISE); // print both sides of the polygones
material->getTechnique(0)->getPass(0)->createTextureUnitState("texture");
material->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
Ogre::Overlay *overlay = Ogre::OverlayManager::getSingletonPtr()->create("BrowserOverlay");
Ogre::OverlayContainer* panel = static_cast<OverlayContainer*>(Ogre::OverlayManager::getSingletonPtr()->createOverlayElement("Panel", "BrowserPanel"));
panel->setPosition(0.0, 0.0);
panel->setDimensions(1.0, 1.0);
panel->setMaterialName("BrowserMaterial");
overlay->add2D(panel);
overlay->show();
this->windowInfo.SetAsWindowless(0, true);
this->clientHandler = new ClientHandler(renderTexture, this->mRoot->getAutoCreatedWindow(), mMouse, this->mCamera, this->mSceneMgr, this->world, this->context);
browserSettings.web_security = STATE_DISABLED;
this->browser = CefBrowserHost::CreateBrowserSync(windowInfo, this->clientHandler.get(),
"file:///home/nathan/Projects/salamancer/dist/bin/hud/index.html",
browserSettings,
NULL);
this->clientHandler->SetBrowser(this->browser);
mRoot->addFrameListener(this->clientHandler.get());
}