コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
        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);
        }
コード例 #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);
        }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
        }
コード例 #8
0
 public static void FillRectangle(this IGsGraphics graphics, GsColor color, GsRectangle rect)
 {
     graphics.FillRectangle(color, rect.X, rect.Y, rect.Width, rect.Height);
 }
コード例 #9
0
ファイル: DrawParams.cs プロジェクト: Lukasy14/game-Alliance
 public DrawParams(GsVector offset, GridFillMode gridFillMode, IGsGraphics graphics)
 {
     Offset   = offset;
     FillMode = gridFillMode;
     Graphics = graphics;
 }