Пример #1
0
    //-----------------------------------------------------------------------
    OverlayElement* Profiler::createTextArea(const String& name, Real width, Real height, Real top, Real left, 
                                         uint fontSize, const String& caption, bool show) {


        OverlayElement* textArea = 
			OverlayManager::getSingleton().createOverlayElement("TextArea", name);
        textArea->setMetricsMode(GMM_PIXELS);
        textArea->setWidth(width);
        textArea->setHeight(height);
        textArea->setTop(top);
        textArea->setLeft(left);
        textArea->setParameter("font_name", "BlueHighway");
        textArea->setParameter("char_height", StringConverter::toString(fontSize));
        textArea->setCaption(caption);
        textArea->setParameter("colour_top", "1 1 1");
        textArea->setParameter("colour_bottom", "1 1 1");

        if (show) {
            textArea->show();
        }
        else {
            textArea->hide();
        }

        return textArea;

    }
Пример #2
0
	void DebugText::updateStats(Ogre::String text)
	{
		static String currFps = "Current FPS: ";
		//static String avgFps = "Average FPS: ";
		//static String bestFps = "Best FPS: ";
		//static String worstFps = "Worst FPS: ";
		//static String tris = "Triangle Count: ";

		// update stats when necessary
		OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
		OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
		OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
		OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
		
		guiAvg->hide();
		//guiCurr->hide();
		guiBest->hide();
		guiWorst->hide();

		//OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");

		/*guiAvg->setCaption(avgFps + StringConverter::toString(mWindow->getAverageFPS()));*/
		guiCurr->setCaption(currFps + StringConverter::toString(mWindow->getLastFPS()));
		//guiBest->setCaption(bestFps + StringConverter::toString(mWindow->getBestFPS())
		//	+" "+StringConverter::toString(mWindow->getBestFrameTime())+" ms");
		//guiWorst->setCaption(worstFps + StringConverter::toString(mWindow->getWorstFPS())
		//	+" "+StringConverter::toString(mWindow->getWorstFrameTime())+" ms");

		//OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
		//guiTris->setCaption(tris + StringConverter::toString(mWindow->getTriangleCount()));

		OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
		guiDbg->setCaption(text);
		//guiDbg->setPosition(0,0);

		
		//mDebugOverlay->

	}
    //-----------------------------------------------------------------------
    OverlayElement* OverlayProfileSessionListener::createPanel(const String& name, Real width, Real height, Real top, Real left, 
                                      const String& materialName, bool show)
    {
        OverlayElement* panel = 
            OverlayManager::getSingleton().createOverlayElement("Panel", name);
        panel->setMetricsMode(GMM_PIXELS);
        panel->setWidth(width);
        panel->setHeight(height);
        panel->setTop(top);
        panel->setLeft(left);
        panel->setMaterialName(materialName);

        if (show) {
            panel->show();
        }
        else {
            panel->hide();
        }

        return panel;
    }