当前位置: 首页>>代码示例>>C++>>正文


C++ OverlayContainer::setMetricsMode方法代码示例

本文整理汇总了C++中OverlayContainer::setMetricsMode方法的典型用法代码示例。如果您正苦于以下问题:C++ OverlayContainer::setMetricsMode方法的具体用法?C++ OverlayContainer::setMetricsMode怎么用?C++ OverlayContainer::setMetricsMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OverlayContainer的用法示例。


在下文中一共展示了OverlayContainer::setMetricsMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createContainer

    //-----------------------------------------------------------------------
    OverlayContainer* Profiler::createContainer() {

        OverlayContainer* container = (OverlayContainer*) 
			OverlayManager::getSingleton().createOverlayElement(
				"BorderPanel", "profiler");
        container->setMetricsMode(GMM_PIXELS);
        container->setMaterialName("Core/StatsBlockCenter");
        container->setHeight(mGuiHeight);
        container->setWidth(mGuiWidth * 2 + 15);
        container->setParameter("border_size", "1 1 1 1");
        container->setParameter("border_material", "Core/StatsBlockBorder");
        container->setParameter("border_topleft_uv", "0.0000 1.0000 0.0039 0.9961");
        container->setParameter("border_top_uv", "0.0039 1.0000 0.9961 0.9961");
        container->setParameter("border_topright_uv", "0.9961 1.0000 1.0000 0.9961");
        container->setParameter("border_left_uv","0.0000 0.9961 0.0039 0.0039");
        container->setParameter("border_right_uv","0.9961 0.9961 1.0000 0.0039");
        container->setParameter("border_bottomleft_uv","0.0000 0.0039 0.0039 0.0000");
        container->setParameter("border_bottom_uv","0.0039 0.0039 0.9961 0.0000");
        container->setParameter("border_bottomright_uv","0.9961 0.0039 1.0000 0.0000");
        container->setLeft(5);
        container->setTop(5);

        return container;

    }
开发者ID:Anti-Mage,项目名称:ogre,代码行数:26,代码来源:OgreProfiler.cpp

示例2: createOverlay

OverlayContainer* MenuSheet::createOverlay(int id, const std::string& text, int x, int y, int w, int h) {
    std::string ovname = mName + "/" + Ogre::StringConverter::toString(id);

    OverlayContainer* ov;

    if (text.empty())
        ov = static_cast<OverlayContainer*>(OverlayManager::getSingleton().createOverlayElement("Panel", ovname));
    else
        ov = static_cast<OverlayContainer*>(OverlayManager::getSingleton().createOverlayElement("TextArea", ovname));

    ov->setMetricsMode(GMM_PIXELS);

    // text area centered around X point, so we create it with w/2 surplus
    if (text.empty())
        ov->setPosition(x, y);
    else
        ov->setPosition(x + w/2, y);

    ov->setDimensions(w, h);

    ov->setCaption(text);
    ov->setParameter("font_name", mFont);
    ov->setParameter("char_height", StringConverter::toString(mFontSize));

    ov->setParameter("alignment", "center");

    ov->show();

    mOverlay->add2D(ov);

    return ov;
}
开发者ID:volca02,项目名称:request,代码行数:32,代码来源:MenuSystem.cpp

示例3: multiplayer

void HUD::multiplayer()
{
	OverlayManager& overlayManager = OverlayManager::getSingleton();

	// Create a panel
	OverlayContainer* panel = static_cast<OverlayContainer*>(
	overlayManager.createOverlayElement("Panel", "MultiplayerPanel"));
	panel->setMetricsMode(Ogre::GMM_PIXELS);
	panel->setPosition(20, 20);
	panel->setDimensions(200, 250);
	panel->setMaterialName("PanelAchtergrondImage"); // Optional background material

	// Create a text area
	m_textMessages = static_cast<TextAreaOverlayElement*>(
	overlayManager.createOverlayElement("TextArea", "MultiplayerTextArea"));

	m_textMessages->setMetricsMode(Ogre::GMM_PIXELS);
	m_textMessages->setPosition(10, 50);
	m_textMessages->setDimensions(150, 100);
	m_textMessages->setCaption("GoClient 0.1");
	m_textMessages->setCharHeight(16);
	m_textMessages->setFontName("ArialFont");
	m_textMessages->setColourBottom(ColourValue(0.6, 0.6, 0.6));
	m_textMessages->setColourTop(ColourValue(1, 1, 1));

	// Create an overlay, and add the panel
	m_overlay = overlayManager.create("MultiplayerOverlay");
	m_overlay->add2D(panel);

	// Add the text area to the panel
	panel->addChild(m_textMessages);

	// Show the overlay
	m_overlay->show();
}
开发者ID:cheesecakenl,项目名称:git-c-plusplus,代码行数:35,代码来源:HUD.cpp


注:本文中的OverlayContainer::setMetricsMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。