コード例 #1
0
 public override void Draw(DrawBatch drawBatch)
 {
     drawBatch.FillRectangle(Brush.Green, new CCRect(50, 50, 200, 100));
     drawBatch.FillCircle(Brush.Blue, new CCVector2(350, 100), 50);
     drawBatch.FillCircle(Brush.Blue, new CCVector2(500, 100), 50, 16);
     drawBatch.FillPath(Brush.Gray, StarPoints(new CCVector2(150, 300), 8, 100, 50, 0, false));
     drawBatch.FillRectangle(Brush.Green, new CCRect(300, 250, 200, 100), (float)Math.PI / 4f);
 }
コード例 #2
0
ファイル: TextureFill.cs プロジェクト: Luckyknight1/LilyPath
 public override void Draw (DrawBatch drawBatch)
 {
     drawBatch.FillRectangle(_brush1, new Rectangle(50, 50, 200, 100));
     drawBatch.FillRectangle(_brush2, new Rectangle(50, 175, 200, 100));
     drawBatch.FillRectangle(_brush3, new Rectangle(50, 300, 200, 100));
     drawBatch.FillRectangle(_brush4, new Rectangle(50, 425, 200, 100));
     drawBatch.FillCircle(_brush5, new Vector2(350, 100), 50);
     drawBatch.FillCircle(_brush6, new Vector2(350, 225), 50);
 }
コード例 #3
0
ファイル: WaterLilly.cs プロジェクト: Luckyknight1/LilyPath
 public override void Draw (DrawBatch drawBatch)
 {
     drawBatch.FillCircle(new SolidColorBrush(Color.SkyBlue), _origin, 175);
     drawBatch.FillArc(new SolidColorBrush(Color.LimeGreen), _origin, 150, _startAngle, _arcLength, ArcType.Sector);
     drawBatch.DrawClosedArc(new Pen(Color.Green, 15), _origin, 150, _startAngle, _arcLength, ArcType.Sector);
     drawBatch.DrawPath(_lilyOuterFlower);
     drawBatch.DrawPath(_lilyInnerFlower);
 }
コード例 #4
0
        public override void Render(DrawBatch drawBatch, float zoomFactor)
        {
            if (IsDisposed)
                return;

            InitializeResources(drawBatch.GraphicsDevice);

            Vector2 center = new Vector2((int)(_data.Center.X * zoomFactor), (int)(_data.Center.Y * zoomFactor));
            float radius = _data.Radius * zoomFactor;

            if (FillGlow != null)
                drawBatch.FillCircle(FillGlow, center, radius + 2);
            if (Fill != null)
                drawBatch.FillCircle(Fill, center, radius);
            if (OutlineGlow != null)
                drawBatch.DrawCircle(OutlineGlow, center, radius);
            if (Outline != null) {
                if (Outline is PrimitivePen)
                    drawBatch.DrawPrimitiveCircle(Outline, center, radius);
                else
                    drawBatch.DrawCircle(Outline, center, radius);
            }
        }
コード例 #5
0
        public override void Draw(DrawBatch drawBatch)
        {
            base.Draw(drawBatch);

            // Use the bounds to layout the positioning of our drawable assets
            var bounds = VisibleBoundsWorldspace;
            var center = bounds.Center;

            InitializePaths();

            drawBatch.FillCircle(new SolidColorBrush(Microsoft.Xna.Framework.Color.SkyBlue), center, 175);
            drawBatch.FillPath(new SolidColorBrush(Microsoft.Xna.Framework.Color.LimeGreen), _lilypadPath.Buffer, 0, _lilypadPath.Count);
            drawBatch.DrawPath(_lilypadStroke);
            drawBatch.DrawPath(_outerFlowerStroke);
            drawBatch.DrawPath(_innerFlowerStroke);

        }
コード例 #6
0
        public override void Draw(DrawBatch drawBatch)
        {
            drawBatch.FillRectangle(_brush1, new CCRect(50, 50, 200, 100));
            drawBatch.FillRectangle(_brush2, new CCRect(50, 175, 200, 100));
            drawBatch.FillRectangle(_brush3, new CCRect(50, 300, 200, 100));
            drawBatch.FillRectangle(_brush4, new CCRect(50, 425, 200, 100));
            drawBatch.FillCircle(_brush5, new CCVector2(350, 100), 50);
            drawBatch.FillCircle(_brush6, new CCVector2(350, 225), 50);

            drawBatch.FillCircle(mirrorBrush, new CCVector2(350, 600), 50);
            drawBatch.FillRectangle(repeatBrush, new CCRect(50, 550, 200, 100));
        }
コード例 #7
0
ファイル: ImportObject.cs プロジェクト: Elof3/Treefrog
        private void DrawObjectAction(DrawBatch drawBatch)
        {
            if (_sourceImage == null)
                return;

            drawBatch.GraphicsDevice.ScissorRectangle = Xna.Rectangle.Empty;

            if (_objectBrush == null)
                _objectBrush = new TextureBrush(_sourceImage.CreateTexture(_drawControl.GraphicsDevice)) { OwnsTexture = true };
            if (_maskPen == null)
                _maskPen = new Pen(new CheckerBrush(_drawControl.GraphicsDevice, Xna.Color.Black, Xna.Color.White, 4, .75f), true);

            int originX = (_drawControl.Width - _sourceImage.Width) / 2;
            int originY = (_drawControl.Height - _sourceImage.Height) / 2;

            _objectBrush.Transform = Xna.Matrix.CreateTranslation(-(float)originX / _sourceImage.Width, -(float)originY / _sourceImage.Height, 0);

            drawBatch.Begin();

            drawBatch.FillRectangle(_objectBrush, new Xna.Rectangle(originX, originY, _sourceImage.Width, _sourceImage.Height));
            drawBatch.DrawRectangle(_maskPen, new Microsoft.Xna.Framework.Rectangle(
                originX - 1 + (_maskLeft ?? 0) + (_originX ?? 0),
                originY - 1 + (_maskTop ?? 0) + (_originY ?? 0),
                1 + (_maskRight - _maskLeft) ?? 0,
                1 + (_maskBottom - _maskTop) ?? 0));

            drawBatch.FillCircle(Brush.White, new Xna.Vector2(originX + _originX ?? 0, originY + _originY ?? 0), 4, 12);
            drawBatch.FillCircle(Brush.Black, new Xna.Vector2(originX + _originX ?? 0, originY + _originY ?? 0), 3, 12);

            drawBatch.End();
        }