Esempio n. 1
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (SelectedPin.IsSet)
            {
                spriteBatch.Circle(SelectedPin.PinPosition, pinsize + 1, Color.Yellow);
            }

            foreach (Vector2 point in InputPins)
            {
                Vector2 p = point + Position.ToVector2();
                spriteBatch.Line(p, _area.Center.ToVector2(), 2, Color.White);
                spriteBatch.Circle(p, pinsize, Color.LightBlue);
            }

            foreach (Vector2 point in OutputPins)
            {
                Vector2 p = Position.ToVector2() + point;
                spriteBatch.Line(p, _area.Center.ToVector2(), 2, Color.White);
                spriteBatch.Circle(p, pinsize, Color.PaleVioletRed);
            }

            if (BodySelected || Selected)
            {
                Rectangle rect = _area;
                rect.Inflate(1, 1);
                spriteBatch.StrokeRect(rect, 2, Color.Red);
            }

            Point test = _originalPosition;

            test.X += gateTexture.Width / 2;
            test.Y += gateTexture.Height / 2;

            Rectangle desp = new Rectangle(test, gateTexture.Bounds.Size);

            if (Outputs[0])
            {
                spriteBatch.Draw(gateTexture, desp, null, Color.LightGreen, rotation, gateTexture.Bounds.Size.ToVector2() / 2, SpriteEffects.None, 0);
            }
            else
            {
                spriteBatch.Draw(gateTexture, desp, null, Color.White, rotation, gateTexture.Bounds.Size.ToVector2() / 2, SpriteEffects.None, 0);
            }


            //spriteBatch.StrokeRect(_boundingBox, 2, Color.Red);
        }
Esempio n. 2
0
 public void Draw(SpriteBatch spriteBatch)
 {
     foreach (Particle p in pool.Alive())
     {
         spriteBatch.Circle(p.Position, p.Size, p.Color);
     }
     //spriteBatch.Rectangle(new Rectangle(p.Position.ToPoint(), new Point((int)p.Size)), p.Color);
 }