コード例 #1
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   Log.i(TAG, "Menu Item selected " + item);
   if (item == mItemStartNewGame) {
     /* We need to start new game */
     mPuzzle15 = new PuzzleProcessor(Settings.getGridSize(this));
     mPuzzle15.prepareGameSize(mGameWidth, mGameHeight);
     mPuzzle15.prepareNewGame();
   } else if (item == mItemHideNumbers) {
     /* We need to enable or disable drawing of the tile numbers */
     mPuzzle15.toggleTileNumbers();
   } else if (item == mItemSettings) {
     final Intent i = new Intent(this, SettingsActivity.class);
     startActivity(i);
   }
   return true;
 }
コード例 #2
0
 public void onCameraViewStarted(int width, int height) {
   mGameWidth = width;
   mGameHeight = height;
   mPuzzle15.prepareGameSize(mGameWidth, mGameHeight);
 }