Esempio n. 1
0
        private void NewGame()
        {                                                        //*** START A NEW GAME ***
            masterImage = (Image)this.Resources["MasterImage1"]; //Get the game image

            BitmapSource bitmap = (BitmapSource)masterImage.Source;

            _puzzleSize = new Size(bitmap.PixelWidth * 1.8, bitmap.PixelHeight * 1.8); //Set the size of the image

            //check if a puzzle already exisits
            if (_gazeAugmentedPuzzleGrid != null)
            {
                _puzzleHostingPanel.Children.Remove(_gazeAugmentedPuzzleGrid); //true remove it
            }

            _gazeAugmentedPuzzleGrid = new GazeAugmentedPuzzleGrid(); //initialise _MousePuzzleGrid

            _gazeAugmentedPuzzleGrid.NumRows = _numRows;              //number of rows in the grid

            _gazeAugmentedPuzzleGrid.PuzzleImage = masterImage;       //background image

            _gazeAugmentedPuzzleGrid.PuzzleSize = _puzzleSize;        //size of the puzzle

            _gazeAugmentedPuzzleGrid.ConfigType = "A";                //Use game congiguration A
            //_gazeAugmentedPuzzleGrid.ConfigType = "B";         //Use game configuration B
            //_gazeAugmentedPuzzleGrid.ConfigType = "T";         //Use trial configuration

            _puzzleHostingPanel.Children.Add(_gazeAugmentedPuzzleGrid); //add grid to the user interface


            _gazeAugmentedPuzzleGrid.StartConfig("ConfigA");       //Use start configuration A
            //_gazeAugmentedPuzzleGrid.StartConfig("ConfigB");       //Use start configuration B
            //_gazeAugmentedPuzzleGrid.StartConfig("Trial");       //Use the trial configuration to start
        }
        private void NewGame()
        {
            //*** START A NEW GAME ***
            masterImage = (Image)this.Resources["MasterImage1"]; //Get the game image

            BitmapSource bitmap = (BitmapSource)masterImage.Source;
            _puzzleSize = new Size(bitmap.PixelWidth * 1.8, bitmap.PixelHeight * 1.8); //Set the size of the image

            //check if a puzzle already exisits
            if (_gazeAugmentedPuzzleGrid != null)
            {
                _puzzleHostingPanel.Children.Remove(_gazeAugmentedPuzzleGrid); //true remove it
            }

            _gazeAugmentedPuzzleGrid = new GazeAugmentedPuzzleGrid(); //initialise _MousePuzzleGrid

            _gazeAugmentedPuzzleGrid.NumRows = _numRows; //number of rows in the grid

            _gazeAugmentedPuzzleGrid.PuzzleImage = masterImage; //background image

            _gazeAugmentedPuzzleGrid.PuzzleSize = _puzzleSize; //size of the puzzle

            _gazeAugmentedPuzzleGrid.ConfigType = "A";           //Use game congiguration A
            //_gazeAugmentedPuzzleGrid.ConfigType = "B";         //Use game configuration B
            //_gazeAugmentedPuzzleGrid.ConfigType = "T";         //Use trial configuration

            _puzzleHostingPanel.Children.Add(_gazeAugmentedPuzzleGrid); //add grid to the user interface

            _gazeAugmentedPuzzleGrid.StartConfig("ConfigA");       //Use start configuration A
            //_gazeAugmentedPuzzleGrid.StartConfig("ConfigB");       //Use start configuration B
            //_gazeAugmentedPuzzleGrid.StartConfig("Trial");       //Use the trial configuration to start
        }