WaveEngine.Components.Toolkit.TextComponent.AddGlyph C# (CSharp) Method

AddGlyph() private method

Adds a glyph to the vertex buffer
private AddGlyph ( char character, System.Vector2 position, Rectangle sourceRectangle ) : void
character char The glyph character
position System.Vector2 The glyph position
sourceRectangle Rectangle The glyph rectangle
return void
        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);
        }