示例#1
0
        /// <summary>
        /// Adds a glyph to the vertex buffer
        /// </summary>
        /// <param name="character">The glyph character</param>
        /// <param name="position">The glyph position</param>
        /// <param name="sourceRectangle">The glyph rectangle</param>
        private void AddGlyph(char character, Vector2 position, Rectangle sourceRectangle)
        {
            var scale  = this.TextScale;
            var width  = sourceRectangle.Width * scale.X;
            var height = sourceRectangle.Height * scale.Y;
            var x      = position.X * scale.X;
            var y      = position.Y * scale.Y;

            var charInfo = new TextCharInfo()
            {
                Character       = character,
                SourceRectangle = sourceRectangle,
                Position        = new RectangleF(x, y, width, height)
            };

            this.charInfoList.Add(charInfo);
        }
示例#2
0
        /// <summary>
        /// Adds a glyph to the vertex buffer
        /// </summary>
        /// <param name="character">The glyph character</param>
        /// <param name="position">The glyph position</param>
        /// <param name="sourceRectangle">The glyph rectangle</param>
        private void AddGlyph(char character, Vector2 position, Rectangle sourceRectangle)
        {
            var scale = this.TextScale;
            var width = sourceRectangle.Width * scale.X;
            var height = sourceRectangle.Height * scale.Y;
            var x = position.X * scale.X;
            var y = position.Y * scale.Y;

            var charInfo = new TextCharInfo()
            {
                Character = character,
                SourceRectangle = sourceRectangle,
                Position = new RectangleF(x, y, width, height)
            };

            this.charInfoList.Add(charInfo);
        }