Zeplin.TextWidget.Draw C# (CSharp) Method

Draw() private method

private Draw ( GameTime now ) : void
now Microsoft.Xna.Framework.GameTime
return void
        private void Draw(GameTime now)
        {
            if (FontFace != null)
            {
                float scale;
                SpriteFont bestFont = FontFace.GetBestFont(FontSize, out scale);

                // calculate position.
                Vector2 size = bestFont.MeasureString(Text);

                Vector2 topLeft = PinSizeAndAlignmentToTopLeft(Position, size, HorizontalAlignment, VerticalAlignment);
                ZeplinGame.spriteBatch.DrawString(bestFont, Text, topLeft, Foreground, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0);
            }
        }