コード例 #1
0
        // CIRCLE HANDLE //////////////////////////////////////////////////////////////////////////////////////////////////
        private void FormMain_MouseUp_BuildCircle(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            if (BuildType != ObstacleType.Circle)
            {
                return;
            }

            LeftMouseIsHolding = false;
            Obstacle NewObstacle = new Obstacle_Circle(LeftMouseDownPos, Utility.Distance(LeftMouseDownPos, MousePos), IsBuildingMirrors);

            Obstacles.Add(NewObstacle);
        }
コード例 #2
0
        private void FormMain_Paint_BuildCircle(object sender, PaintEventArgs e)
        {
            if (!LeftMouseIsHolding)
            {
                return;
            }
            if (BuildType != ObstacleType.Circle)
            {
                return;
            }

            Graphics g = e.Graphics;
            Pen      p = new Pen(Color.LightPink, 5f);
            Obstacle o = new Obstacle_Circle(LeftMouseDownPos, Utility.Distance(LeftMouseDownPos, MousePos), IsBuildingMirrors);

            o.Show(g, p);
        }