//-----------------------------------------------------------------------
    void TextAreaOverlayElement::_update(void)
    {
        Real vpWidth, vpHeight;
        vpWidth = (Real) (OverlayManager::getSingleton().getViewportWidth());
        vpHeight = (Real) (OverlayManager::getSingleton().getViewportHeight());

        mViewportAspectCoef = vpHeight/vpWidth;

        // Check size if pixel-based / relative-aspect-adjusted
        switch (mMetricsMode)
        {
        case GMM_PIXELS:
            if(mGeomPositionsOutOfDate)
            {
                // recalculate character size
                mCharHeight = (Real) mPixelCharHeight / vpHeight;
                mSpaceWidth = (Real) mPixelSpaceWidth / vpHeight;
                mGeomPositionsOutOfDate = true;
            }
            break;

        case GMM_RELATIVE_ASPECT_ADJUSTED:
            if(mGeomPositionsOutOfDate)
            {
                // recalculate character size
                mCharHeight = (Real) mPixelCharHeight / 10000.0f;
                mSpaceWidth = (Real) mPixelSpaceWidth / 10000.0f;
                mGeomPositionsOutOfDate = true;
            }
            break;

        default:
            break;
        }

        OverlayElement::_update();

        if (mColoursChanged && mInitialised)
        {
            updateColours();
            mColoursChanged = false;
        }
    }
Example #2
0
	void TextureControl::setColour(MyGUI::Colour _value)
	{
		mCurrentColour = _value;
		updateColours();
	}