public void Draw(Texture2D tex, Rectangle source, Rectangle dest, Color4 color, BlendMode mode = BlendMode.Normal, bool flip = false, QuadRotation orient = QuadRotation.None) { DrawQuad(tex, source, dest, color, mode, flip, orient); }
void DrawQuad(Texture2D tex, Rectangle source, Rectangle dest, Color4 color, BlendMode mode, bool flip = false, QuadRotation orient = QuadRotation.None) { if (rs.ScissorEnabled && !dest.Intersects(rs.ScissorRectangle)) { return; } Prepare(mode, tex, false); float x = (float)dest.X; float y = (float)dest.Y; float w = (float)dest.Width; float h = (float)dest.Height; float srcX = (float)source.X; float srcY = (float)source.Y; float srcW = (float)source.Width; float srcH = (float)source.Height; var p1 = new Vector2(x, y); var p2 = new Vector2(x + w, y); var p3 = new Vector2(x, y + h); var p4 = new Vector2(x + w, y + h); bool clipped = false;
public void DrawImageStretched(Texture2D tex, Rectangle dest, Color4 color, bool flip = false, QuadRotation orient = QuadRotation.None) { DrawQuad( tex, new Rectangle(0, 0, tex.Width, tex.Height), dest, color, BlendMode.Normal, flip, orient ); }