Nez.Portable/Graphics/SVG/SvgDebugComponent.cs
/// <summary>
/// attempts to load and draw the SvgImage. If it cannot load a Texture it will just draw a rect.
/// </summary>
/// <param name="batcher">Batcher.</param>
/// <param name="images">Images.</param>
attempts to load and draw the SvgImage. If it cannot load a Texture it will just draw a rect.
attempts to load and draw the SvgImage . If it cannot load a Texture it will just draw a rect .
void renderImages(Batcher batcher, SvgImage[] images)
        {
            if (images == null)
                return;
            foreach (var image in images)
            {
                var tex = image.getTexture(entity.scene.content);
                if (tex != null)
                {
                    var rotation = image.rotationDegrees * Mathf.deg2Rad;
                    if (rotation == 0)
                    {
                        batcher.draw(tex, image.rect);
                    }
                    else
                    {
                        var rect = image.rect;
                        var origin = new Vector2(0.5f * rect.width, 0.5f * rect.height);
                        rect.location += origin;
                        batcher.draw(tex, rect, null, Color.White, rotation, origin, SpriteEffects.None, layerDepth);
                    }
                }
                else
                {
                    batcher.drawRect(image.x, image.y, image.width, image.height, Color.DarkRed);
                }
            }
        }
void renderImages ( Batcher batcher , SvgImage [ ] images ) { if ( images == null ) return ; foreach ( var image in images ) { var tex = image . getTexture ( entity . scene . content ) ; if ( tex != null ) { var rotation = image . rotationDegrees * Mathf . deg2Rad ; if ( rotation == 0 ) { batcher . draw ( tex , image . rect ) ; } else { var rect = image . rect ; var origin = new Vector2 ( 0.5f * rect . width , 0.5f * rect . height ) ; rect . location += origin ; batcher . draw ( tex , rect , null , Color . White , rotation , origin , SpriteEffects . None , layerDepth ) ; } } else { batcher . drawRect ( image . x , image . y , image . width , image . height , Color . DarkRed ) ; } } }
attempts to load and draw the SvgImage.
attempts to load and draw the SvgImage .
batcher
Batcher
None
images
SvgImage[]
None