FSO.Client.UI.Framework.UIElement.DrawLocalString C# (CSharp) Method

DrawLocalString() public method

This utility will draw a line of text onto the UIElement.
public DrawLocalString ( SpriteBatch batch, string text, Vector2 to, TextStyle style ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to draw the text onto
text string The content of the text
to Vector2 The position of the text. Relative to this UIElement.
style TextStyle The text style
return void
        public void DrawLocalString(SpriteBatch batch, string text, Vector2 to, TextStyle style)
        {
            var scale = _Scale;
            if (style.Scale != 1.0f)
            {
                scale = new Vector2(scale.X * style.Scale, scale.Y * style.Scale);
            }
            //to.Y += style.BaselineOffset;
            to.X = (float)Math.Floor(to.X);
            to.Y = (float)Math.Floor(to.Y);
            batch.DrawString(style.SpriteFont, text, LocalPoint(to), style.Color, 0, Vector2.Zero, scale, SpriteEffects.None, 0);
        }

Same methods

UIElement::DrawLocalString ( SpriteBatch batch, string text, Vector2 to, TextStyle style, Rectangle bounds, TextAlignment align ) : void
UIElement::DrawLocalString ( SpriteBatch batch, string text, Vector2 to, TextStyle style, Rectangle bounds, TextAlignment align, Rectangle margin ) : void
UIElement::DrawLocalString ( SpriteBatch batch, string text, Vector2 to, TextStyle style, Rectangle bounds, TextAlignment align, Rectangle margin, UIElementState state ) : void