measureString() public method

Returns the size of the contents of a StringBuilder when rendered in this font.
public measureString ( StringBuilder text ) : Vector2
text StringBuilder The text to measure.
return Vector2
Ejemplo n.º 1
0
        void updateSize()
        {
            if (_bitmapFont != null)
            {
                _size = _bitmapFont.measureString(text);
            }
            else
            {
                _size = _spriteFont.measureString(text);
            }

            updateCentering();
        }
Ejemplo n.º 2
0
        public float getHeight()
        {
            switch (drawType)
            {
            case DebugDrawType.Line:
                return((end - start).Y);

            case DebugDrawType.HollowRectangle:
                return(rectangle.Height);

            case DebugDrawType.BitmapFontText:
            case DebugDrawType.ConsoleText:
                return(bitmapFont.measureString(text).Y *scale);

            case DebugDrawType.SpriteFontText:
                return(spriteFont.measureString(text).Y *scale);
            }

            return(0);
        }