Example #1
0
        public void DrawGlyph(Texture2D atlas, Rectangle destinationRectangle, float left, float bottom, float right, float top, Color color)
        {
            var ntop    = atlas.Height - top;
            var nbottom = atlas.Height - bottom;

            NeoBatchItem item = _batcher.CreateBatchItem();

            item.Texture = atlas;

            _texCoordTL.X = left * (1f / (float)atlas.Width);
            _texCoordTL.Y = ntop * (1f / (float)atlas.Height);
            _texCoordBR.X = right * (1f / (float)atlas.Width);
            _texCoordBR.Y = nbottom * (1f / (float)atlas.Height);

            item.Set(destinationRectangle.X,
                     destinationRectangle.Y,
                     destinationRectangle.Width,
                     destinationRectangle.Height,
                     color,
                     _texCoordTL,
                     _texCoordBR);
            item.Type = NeoBatchItem.ItemType.Glyph;
        }