public virtual void Draw(CanvasDrawingSession graphics) { if (_bulletSprite != null && IsActive) { _bulletSprite.Polygon = new Vector2[] { new Vector2(-1 + _location.X, -1 + _location.Y), new Vector2(-1 + _location.X, 1 + _location.Y), new Vector2(1 + _location.X, _location.Y), new Vector2(-1 + _location.X, -1 + _location.Y) }; var clone = _bulletSprite.Polygon.ClonePolygon(); graphics.DrawPolygon(clone, Colors.White); } }
public void Draw(CanvasDrawingSession graphics) { if (IsActive) { double currentRotation = _rotation.DegreesToRadians(); Vector2[] clone = _meteorSprite.Polygon.ClonePolygon().Rotate(_location, currentRotation); //graphics.DrawLine(Pens.White, (float)dx1, (float)dy1, (float)dx2, (float)dy2); graphics.DrawPolygon(clone, Colors.White); //graphics.DrawString(_meteorType.Text, new Font("Courier New", 10), Brushes.White, _location.X, _location.Y); } }
private void DrawThruster(double rotation, CanvasDrawingSession graphics) { if (_thrusterIsOn) { var location = _shipSprite.Location; var thruster = new[] { new Vector2(-18 + location.X, location.Y), new Vector2(-10 + location.X, -6 + location.Y), new Vector2(-10 + location.X, 6 + location.Y), new Vector2(-18 + location.X, location.Y), }; Vector2[] thrusterClone = thruster.ClonePolygon().Rotate(location, rotation); graphics.DrawPolygon(thrusterClone, Colors.DarkGray); } }