Exemplo n.º 1
0
        public override void Draw(SpriteBatch sb)
        {
            //_pos = Camera.Current.GetRay(Mouse.GetState().Position.ToVector2());
            sb.BeginAA();
            _pos = Mouse.GetState().Position.ToVector2();
            if (_wasDrawing)
            {
                if (_drawState == DrawState.CIRCLE)
                {
                    float radius = (_pos - _lastPoint.Coord).Length();
                    GUI.DrawCircle(sb, _lastPoint.Coord, radius, 2, Color.DarkGray, 100);
                }
                else if (_drawState == DrawState.SEGMENT)
                {
                    GUI.DrawLine(sb, _lastPoint.Coord, _pos, 2, Color.DarkGray);
                }
                else if (_drawState == DrawState.VECTOR)
                {
                    new Vector(_lastPoint, new Dot(_pos)).Draw(sb);
                }
                else if (_drawState == DrawState.LINE)
                {
                    new Line(new Dot(_lastPoint.Coord), new Dot(_pos)).Draw(sb);
                }
                else if (_drawState == DrawState.DOT)
                {
                    _lastPoint.Draw(sb);
                }
            }

            UpdateLists(sb);
            sb.End();
        }
Exemplo n.º 2
0
        public override void Draw(SpriteBatch sb)
        {
            //_pos = Camera.Current.GetRay(Mouse.GetState().Position.ToVector2());
            sb.BeginAA();
            _pos = Mouse.GetState().Position.ToVector2() + Location;
            if (_wasDrawing || _drawState == DrawState.ELLIPSE_POINT)
            {
                if (_drawState == DrawState.CIRCLE)
                {
                    float radius = (_pos - _lastPoint.Coord).Length();
                    GUI.DrawCircle(sb, _lastPoint.Coord - Location, radius, 2, Color.DarkGray, 100);
                }
                else if (_drawState == DrawState.ELLIPSE)
                {
                    _lastPoint.Draw(sb);
                }
                else if (_drawState == DrawState.ELLIPSE_POINT)
                {
                    _ellipseLastPoint.Draw(sb);
                    Ellipse.FromThreeDots(_ellipseLastPoint, _lastPoint, Dot.FromCoord(_pos)).Draw(sb);
                }
                else if (_drawState == DrawState.SEGMENT)
                {
                    GUI.DrawLine(sb, _lastPoint.Coord - Location, _pos - Location, 2, Color.DarkGray);
                }
                else if (_drawState == DrawState.VECTOR)
                {
                    Vector.FromTwoDots(_lastPoint, Dot.FromCoord(_pos)).Draw(sb);
                }
                else if (_drawState == DrawState.LINE)
                {
                    Line.FromTwoPoints(_lastPoint.Coord, _pos).Draw(sb);
                }
                else if (_drawState == DrawState.DOT)
                {
                    _lastPoint.Draw(sb);
                }
            }

            UpdateLists(sb);
            sb.End();
        }