Beispiel #1
0
        /// <summary>
        /// constructor
        /// </summary>
        public GridBackground()
        {
            InitializeComponent();

            xMyCanvas.PointerReleased += handlePointerReleased;

            uint nrGridRows = GridLinePainter.GetNrGridRows(xMyCanvas);

            // paint background color
            this.xMyCanvas.Background = GridBrushDefs.backgroundBrush;

            // paint the background grid lines
            GridLinePainter.PaintGridLines(xMyCanvas, nrGridRows);

            // get a standard car with acceleration = 1
            mActiveCar = new StandardCar(1);
        }
        /// <summary>
        /// constructor
        /// </summary>
        public GridBackgroundTrackCreation()
        {
            InitializeComponent();

            xMyCanvas.PointerPressed  += handlePointerPressed;
            xMyCanvas.PointerMoved    += handlePointerMoved;
            xMyCanvas.PointerReleased += handlePointerReleased;

            uint nrGridRows = GridLinePainter.GetNrGridRows(xMyCanvas);

            // paint background color of track creation grid
            this.xMyCanvas.Background = BackgroundBrushTrackCreation;

            // paint the background grid lines
            GridLinePainter.PaintGridLines(xMyCanvas, nrGridRows);

            // paint starting line candidate so that user knows where to start
            PaintStartingLineCandidate();

            // reset all drawing member variables
            ResetDrawings();
        }