Esempio n. 1
0
    @Override
    public void surfaceDestroyed(SurfaceHolder arg0) {
      stop();
      _thread.setRunning(false);
      while (true) {
        try {
          _thread.join();
          break;
        } catch (InterruptedException e) {

        }
      }
    }
Esempio n. 2
0
 @Override
 public void surfaceCreated(SurfaceHolder arg0) {
   setKeepScreenOn(true);
   _thread.setRunning(true);
   _thread.start();
   // Start setting paints with anti alias and color
   whiteTextPaint.setColor(Color.WHITE);
   whiteTextPaint.setAntiAlias(true);
   whiteTextPaint.setTextSize(14);
   blackTextPaint.setColor(Color.BLACK);
   blackTextPaint.setAntiAlias(true);
   blackTextPaint.setTextSize(14);
   largeTextPaint.setColor(Color.WHITE);
   largeTextPaint.setAntiAlias(true);
   largeTextPaint.setTextSize(32);
   redTextPaint.setColor(Color.RED);
   redTextPaint.setAntiAlias(true);
   redTextPaint.setTextSize(18);
   ColorMatrix cm = new ColorMatrix(mx);
   invert.setColorFilter(new ColorMatrixColorFilter(cm));
   invert.setAntiAlias(true);
   // End settings paint
   // Set bitmap dimensions
   bulletW = bulletBitmap.getWidth();
   bulletH = bulletBitmap.getHeight();
   squareW = squareBitmap.getWidth();
   squareH = squareBitmap.getHeight();
   parabolicW = parabolicBitmap.getWidth();
   parabolicH = parabolicBitmap.getHeight();
   turningW = turningBitmap.getWidth();
   turningH = turningBitmap.getHeight();
   homingW = homingBitmap.getWidth();
   homingH = homingBitmap.getHeight();
   berzerkW = berzerkBitmap.getWidth();
   berzerkH = berzerkBitmap.getHeight();
   mcW = mcBitmap.getWidth();
   mcH = mcBitmap.getHeight();
   // End setting bitmap dimensions
 }