Esempio n. 1
0
        public static void DrawImage(this IGsGraphics graphics, ImageParams data, GsColor color, GsRectangle source)
        {
            var size = data.ImageSize.ToVector() * data.Scale;
            var dest = new GsRectangle(data.Position, size.ToSize());

            graphics.DrawImage(data.Image, dest, source, data.Origin, 0f, GsImageFlip.None, color);
        }
Esempio n. 2
0
        public static void DrawImage(this IGsGraphics graphics, ImageParams data, GsColor color, GsVector offset, float rotation, GsImageFlip flip)
        {
            var size = data.ImageSize.ToVector() * data.Scale;
            var dest = new GsRectangle(data.Position + offset, size.ToSize());

            graphics.DrawImage(data.Image, dest, null, data.Origin, rotation, flip, color);
        }
        public static void DrawString(this IGsGraphics graphics, GsFont font, string text, float x, float y, float width, float height, GsColor color, GsAlignment alignment)
        {
            var size = GsTextMeasurer.MeasureString(font, text);
            var pos  = CalculatePosition(size, x, y, width, height, alignment);

            graphics.DrawString(font, text, pos.X, pos.Y, color);
        }
Esempio n. 4
0
        public void Draw(IGsGraphics graphics)
        {
            DrawParams dparams = new DrawParams(MiddleOffset + Position, FillMode, graphics);

            DrawGrid(dparams);
            DrawPieces(dparams);
            DrawInvaders(dparams);
            DrawProjectiles(dparams);
            DrawPieceRadius(dparams);

            mGui.Draw(graphics);
        }
Esempio n. 5
0
 public static void FillEllipse(this IGsGraphics graphics, GsColor color, GsVector loc, GsSize size)
 {
     graphics.FillEllipse(color, loc.X, loc.Y, size.Width, size.Height);
 }
Esempio n. 6
0
 public static void DrawString(this IGsGraphics graphics, GsFont font, string text, GsVector pos, GsColor color)
 {
     graphics.DrawString(font, text, pos.X, pos.Y, color);
 }
Esempio n. 7
0
        public static void DrawImage(this IGsGraphics graphics, GsImage image, GsColor color, GsVector location, GsVector scale)
        {
            var size = ImageProvider.GetSize(image).ToVector() * scale;

            graphics.DrawImage(image, location.X, location.Y, size.X, size.Y, color);
        }
 public static void FillRectangle(this IGsGraphics graphics, GsColor color, GsRectangle rect)
 {
     graphics.FillRectangle(color, rect.X, rect.Y, rect.Width, rect.Height);
 }
Esempio n. 9
0
 public DrawParams(GsVector offset, GridFillMode gridFillMode, IGsGraphics graphics)
 {
     Offset   = offset;
     FillMode = gridFillMode;
     Graphics = graphics;
 }