コード例 #1
0
 private void handleInput() {
   if (Gdx.input.isButtonPressed(Buttons.LEFT)) {
     if (isSelected) {
       switch (menuIndex) {
         case 0:
           // Sound
           if (GameUtils.getInstance().music) {
             GameUtils.getInstance().music = false;
             txtMusic.content = "Music: OFF";
           } else {
             GameUtils.getInstance().music = true;
             txtMusic.content = "Music: ON";
           }
           break;
         case 1:
           // Music
           if (GameUtils.getInstance().sound) {
             GameUtils.getInstance().sound = false;
             txtSound.content = "Sound: OFF";
           } else {
             GameUtils.getInstance().sound = true;
             txtSound.content = "Sound: ON";
           }
           break;
         case 2:
           this.mGame.setScreen(new MainMenuScreen(mGame));
           break;
         default:
           break;
       }
     }
   }
 }
コード例 #2
0
  @Override
  public void render(float delta) {
    // TODO Auto-generated method stub
    GameUtils.clearScreen();
    mBatch.begin();
    mBatch.draw(background, 0, 0);
    txtTitle.Draw(mBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    txtMusic.Draw(mBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    txtSound.Draw(mBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    txtBack.Draw(mBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    mBatch.draw(selector, 25, selector_Y);
    mBatch.end();

    handleInput();
  }
コード例 #3
0
  @Override
  public void render(float delta) {
    // TODO Auto-generated method stub
    GameUtils.clearScreen();
    mSpriteBatch.begin();
    mSpriteBatch.draw(mTextureBackground, 0, 0);
    mTxtChooseTitle.Draw(mSpriteBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    mTxtEasy.Draw(mSpriteBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    mTxtNormal.Draw(mSpriteBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    mTxtHard.Draw(mSpriteBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    mTxtExit.Draw(mSpriteBatch, GameUtils.getInstance().systemFont, Color.WHITE);
    mSpriteBatch.draw(mTextureSelector, 25, selector_Y);
    mSpriteBatch.end();

    handleInput();
  }