本文整理汇总了C++中ogre::OverlayElement::setHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ OverlayElement::setHeight方法的具体用法?C++ OverlayElement::setHeight怎么用?C++ OverlayElement::setHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::OverlayElement
的用法示例。
在下文中一共展示了OverlayElement::setHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddTextBox
void TextRenderer::AddTextBox(const std::string &id,
const std::string &text,
Ogre::Real x, Ogre::Real y,
Ogre::Real width, Ogre::Real height,
const Ogre::ColourValue &color)
{
Ogre::OverlayElement *textBox = m_overlayMgr->createOverlayElement("TextArea", id);
textBox->setDimensions(width, height);
textBox->setMetricsMode(Ogre::GMM_PIXELS);
textBox->setPosition(x, y);
textBox->setWidth(width);
textBox->setHeight(height);
textBox->setParameter("font_name", "DebugFont");
textBox->setParameter("char_height", "16");
textBox->setColour(color);
textBox->setCaption(text);
m_panel->addChild(textBox);
}
示例2: test
void test()
{
Ogre::Root* pOgre = new Ogre::Root("", "");
pOgre->loadPlugin(RENDER_SYSTEM);
pOgre->setRenderSystem(pOgre->getAvailableRenderers().front());
pOgre->initialise(false);
Ogre::NameValuePairList lArgs;
//lArgs["externalWindowHandle"] = bk::format("%d", (bk::uint)l_window.get_handle()).astr;
Ogre::RenderWindow* pWindow = pOgre->createRenderWindow("Heart|Dockyard", 1024, 768, false, &lArgs);
Ogre::SceneManager* pSceneManager = pOgre->createSceneManager(Ogre::ST_GENERIC,"SceneManager");
pSceneManager->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);
pSceneManager->setShadowCameraSetup(Ogre::ShadowCameraSetupPtr(new Ogre::FocusedShadowCameraSetup()));
pSceneManager->setAmbientLight(Ogre::ColourValue(0.1f, 0.1f, 0.1f));
Ogre::Camera* pCamera = pSceneManager->createCamera("Camera");
pCamera->setFixedYawAxis(true, Ogre::Vector3::UNIT_Z);
pCamera->setPosition(Ogre::Vector3(0.0f, 50.0f, 20.0f));
pCamera->lookAt(Ogre::Vector3(0.0f, 0.0f, 0.0f));
pCamera->setNearClipDistance(0.1f);
pCamera->setFarClipDistance(100.0f);
Ogre::Viewport* pViewport = pWindow->addViewport(pCamera);
pViewport->setBackgroundColour(Ogre::ColourValue(0.0f, 0.0f, 0.0f));
pCamera->setAspectRatio(Ogre::Real(pViewport->getActualWidth()) / Ogre::Real(pViewport->getActualHeight()));
Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../data/dockyard.zip", "Zip", "Dockyard", true);
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
Ogre::MeshManager::getSingleton().createPlane("GroundPlane", "Dockyard", Ogre::Plane(0.0f, 0.0f, 1.0f, 0.0f), 100.0f, 100.0f, 100, 100, true, 1, 3.0f, 3.0f);
Ogre::Entity* pGroundEntity = pSceneManager->createEntity("GroundPlane");
pGroundEntity->setMaterialName("Examples/Rockwall");
pGroundEntity->setCastShadows(false);
pGroundEntity->getSubEntity(0)->getMaterial()->setShadingMode(Ogre::SO_PHONG);
Ogre::SceneNode* pGroundNode = pSceneManager->getRootSceneNode()->createChildSceneNode();
pGroundNode->attachObject(pGroundEntity);
Ogre::Entity* pCubeEntity = pSceneManager->createEntity("Cube", Ogre::SceneManager::PT_CUBE);
pCubeEntity->setMaterialName("Examples/10PointBlock");
pCubeEntity->setCastShadows(true);
Ogre::SceneNode* pCubeNode = pSceneManager->getRootSceneNode()->createChildSceneNode();
pCubeNode->attachObject(pCubeEntity);
pCubeNode->setPosition(0.0f, 0.0f, 5.f);
pCubeNode->setScale(0.1f, 0.1f, 0.1f);
Ogre::ColourValue lColour1(1.0f, 1.0f, 1.0f);
Ogre::ColourValue lColour2(1.0f, 1.0f, 1.0f);
Ogre::ColourValue lColour3(1.0f, 1.0f, 1.0f);
Ogre::Light* pLight1 = pSceneManager->createLight();
pLight1->setType(Ogre::Light::LT_SPOTLIGHT);
pLight1->setPosition(30.0f, 30.0f, 30.0f);
pLight1->setDirection(-1.0f, -1.0f, -1.0f);
pLight1->setSpotlightRange(Ogre::Degree(30), Ogre::Degree(50));
pLight1->setDiffuseColour(lColour1 * 0.5f);
Ogre::Light* pLight2 = pSceneManager->createLight();
pLight2->setType(Ogre::Light::LT_SPOTLIGHT);
pLight2->setPosition(-30.0f, 30.0f, 30.0f);
pLight2->setDirection(1.0f, -1.0f, -1.0f);
pLight2->setSpotlightRange(Ogre::Degree(30), Ogre::Degree(50));
pLight2->setDiffuseColour(lColour2 * 0.5f);
Ogre::Light* pLight3 = pSceneManager->createLight();
pLight3->setType(Ogre::Light::LT_SPOTLIGHT);
pLight3->setPosition(30.0f, -30.0f, 30.0f);
pLight3->setDirection(-1.0f, 1.0f, -1.0f);
pLight3->setSpotlightRange(Ogre::Degree(30), Ogre::Degree(50));
pLight3->setDiffuseColour(lColour3 * 0.5f);
Ogre::Overlay* pMenuOverlay = Ogre::OverlayManager::getSingleton().create("Menu");
Ogre::OverlayElement* pMenu = Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Menu");
pMenu->setMetricsMode(Ogre::GMM_PIXELS);
pMenu->setWidth(200);
pMenu->setHeight(200);
pMenu->setTop(30);
pMenu->setLeft(30);
pMenu->setMaterialName("Examples/BumpyMetal");
if (pMenu->isContainer()) pMenuOverlay->add2D(static_cast<Ogre::OverlayContainer*>(pMenu));
pMenuOverlay->show();
pOgre->startRendering();
}