public void DrawImage(GsImage image, GsRectangle dest, GsRectangle?source, GsVector origin, float angle, GsImageFlip flip, GsColor tint) { SwitchMode(Mode.Sprites); Rectangle?src = null; if (source.HasValue) { var s = source.Value; src = new Rectangle((int)s.X, (int)s.Y, (int)s.Width, (int)s.Height); } var dst = new RectangleF(dest.X, dest.Y, dest.Width, dest.Height); spriteBatch.Draw(image.Data as Texture2D, dst, src, tint.ToColor(), angle, new Vector2(origin.X, origin.Y), flip.ToSpriteEffects(), 0f); }
public void DrawImage(GsImage image, float x, float y, float width, float height, GsColor tint) { SwitchMode(Mode.Sprites); spriteBatch.Draw(image.Data as Texture2D, new RectangleF(x, y, width, height), tint.ToColor()); }
private static VertexPositionColor CreateVertex(GsColor color, float x, float y) { return(new VertexPositionColor(new Vector3(x, y, 0), color.ToColor())); }
public void DrawString(GsFont font, string text, float x, float y, GsColor color) { SwitchMode(Mode.Sprites); spriteBatch.DrawString(font.Data as SpriteFont, text, new Vector2(x, y), color.ToColor()); }
private static VertexPositionColor CreateVertex(GsColor color, GsVector v) { return(new VertexPositionColor(new Vector3(v.X, v.Y, 0), color.ToColor())); }