コード例 #1
0
ファイル: MainField.cs プロジェクト: felipefill/SEC
        /// <summary>
        /// Draw the ball.
        /// </summary>
        /// <param name="g">Graphics used to draw the ball.</param>
        /// <param name="ball">Ball to be drawn.</param>
        public void DrawBall(Graphics g, Log.LogContent.FrameContent.Ball ball)
        {
            // Checks if the ball actually exists.
            if (ball != null)
            {
                /**
                  * The coordinates in the database and here are different.
                  * ConvertAndScale will convert the ball's coordinates to fit the new pattern.
                  */
                ball = ConvertAndScale(ball);

                // Draws the ball.
                g.FillEllipse(Brushes.Orange, ball.GetX(), ball.GetY(), DimensionsScaled.Ball, DimensionsScaled.Ball);
            }
        }