Example #1
0
        /// <summary>
        /// Draws the control and its' children.
        /// </summary>
        /// <param name="batch">An spritebactch already started for alpha blending with deferred sort mode.</param>
        public override void Draw(SpriteBatch batch)
        {
            var heightOffset = 0f;

            for (int i = startIndex - 1; i >= 0; i--)
            {
                var line = text[i];
                var size = font.MeasureParsedString(line, Scale, Area.Width);

                var position = new Vector2(Area.X, Area.Y + (Direction == GrowthDirection.Down ? heightOffset : Area.Height - heightOffset - size.Y));
                batch.DrawParsedString(Font, line, position, Colour, 0, Vector2.Zero, Scale, Area.Width, Justification);

                heightOffset += size.Y;
                if (heightOffset > Area.Height)
                    break;
            }

            base.Draw(batch);
        }
Example #2
0
 /// <summary>
 /// Draws the control.
 /// </summary>
 /// <param name="batch">An spritebactch already started for alpha blending with deferred sort mode.</param>
 public override void Draw(SpriteBatch batch)
 {
     batch.DrawParsedString(Font, Text, new Vector2(Area.X, Area.Y), Colour, 0, Vector2.Zero, Scale, Area.Width, Justification);
 }