示例#1
0
 public static void DrawRectangle(IRenderConfiguration renderConfig,
                                  Vector2 position, Vector2 size,
                                  Color FillColor)
 {
     ScreenQuad.RenderQuad(position, size, FillColor, 0,
                           Texture.SingleWhite.NativeTexture, renderConfig);
 }
示例#2
0
        public void RenderOnScreen(RectangleF sourceRect, RectangleF destRect, Color col, float rotation, bool flipX = false, bool flipY = false)
        {
            Vector2 Scale        = renderConfig.Scale;
            Vector2 ScaledOffset = renderConfig.ScaledOffset;

            Vector2 scale = new Vector2(flipX ? -Scale.X : Scale.X, flipY ? -Scale.Y : Scale.Y);

            scale    = new Vector2(Scale.X, Scale.Y);
            scale.X *= destRect.Width / sourceRect.Width;
            scale.Y *= destRect.Height / sourceRect.Height;

            float radRotation = rotation * ((float)Math.PI / 180.0f);

            ScreenQuad.RenderQuad(new Vector2(destRect.X, destRect.Y),
                                  new Vector2(destRect.Width, destRect.Height),
                                  col, radRotation, this.nativeTexture,
                                  renderConfig);
        }