示例#1
0
        public void DrawScaled(TextureRegion2D texture, FPoint centerTarget, float scale, Color color, float rotation = 0, float layerDepth = 0)
        {
#if DEBUG
            IncRenderSpriteCount();
#endif

            internalBatch.Draw(
                texture.Texture,
                centerTarget.ToVec2D(),
                texture.Bounds,
                color,
                rotation,
                texture.VecCenter(),
                TexScale * scale,
                SpriteEffects.None,
                0);
        }
示例#2
0
        public void DrawStretched(TextureRegion2D textureRegion, FRectangle destinationRectangle, Color color, float rotation = 0f, float layerDepth = 0f)
        {
#if DEBUG
            IncRenderSpriteCount();
#endif

            internalBatch.Draw(
                textureRegion.Texture,
                destinationRectangle.VecCenter,
                textureRegion.Bounds,
                color,
                rotation,
                textureRegion.VecCenter(),
                new Vector2(destinationRectangle.Width / textureRegion.Width, destinationRectangle.Height / textureRegion.Height),
                SpriteEffects.None,
                layerDepth);
        }
示例#3
0
        public void DrawCentered(TextureRegion2D texture, FPoint centerTarget, float width, float height, Color color, float rotation = 0f, float layerDepth = 0f)
        {
#if DEBUG
            IncRenderSpriteCount();
#endif

            var scale = new Vector2(width / texture.Bounds.Width, height / texture.Bounds.Height);

            internalBatch.Draw(
                texture.Texture,
                centerTarget.ToVec2D(),
                texture.Bounds,
                color,
                rotation,
                texture.VecCenter(),
                scale,
                SpriteEffects.None,
                layerDepth);
        }