コード例 #1
0
ファイル: PuzzleGame.java プロジェクト: DigiToy/FF_norm
    // the method that draws the rectangles
    @Override
    protected void onDraw(Canvas canvas) {
      // canvas.drawBitmap(backgroundImage.getBitmap(), 0, 0, null);
      // canvas.drawBitmap(imgBack.getBitmap(), imgBack.getX(),
      // imgBack.getY(), null);
      //
      // if (AppSettings.soundIsOn) {
      // canvas.drawBitmap(imgSoundOn.getBitmap(), imgSoundOn.getX(),
      // imgSoundOn.getY(), null);
      // } else {
      // canvas.drawBitmap(imgSoundOff.getBitmap(), imgSoundOff.getX(),
      // imgSoundOff.getY(), null);
      // }

      canvas.drawBitmap(imgShow.getBitmap(), imgShow.getX(), imgShow.getY(), null);

      if (isPressedInShow) {
        canvas.drawBitmap(
            frameColorRect.getBitmap(), frameColorRect.getX(), frameColorRect.getY(), null);
      } else {
        canvas.drawBitmap(
            backFrameColorRect.getBitmap(),
            backFrameColorRect.getX(),
            backFrameColorRect.getY(),
            null);
      }
      for (int i = 0; i < colorRects.size(); i++) {

        canvas.drawBitmap(
            colorRects.get(i).getBitmap(),
            colorRects.get(i).getX(),
            colorRects.get(i).getY(),
            null);
      }
      countOfUndragebleImages = 0;
      for (int i = 0; i < colorRects.size(); i++) {
        if (!colorRects.get(i).getIsDrawable()) {
          countOfUndragebleImages++;
        }
      }
      if (countOfUndragebleImages == 12 && gameIsOnProcess) {
        PuzzleGame.this.showWinDialog();
        gameIsOnProcess = false;
      }
    }