Beispiel #1
0
  public void Draw(Canvas canvas) {
    canvas.drawBitmap(ret, pos.x, canvas.getHeight() - (pos.y + scale.y), null);

    // testing line------------------------------------------------//
    if (state == STATE.DRAGGING) {
      paint.setColor(Color.RED);
      paint.setStrokeWidth(10);

      // From startPos to current dragging pos
      canvas.drawLine(
          startPos.x,
          canvas.getHeight() - startPos.y,
          fingerPos.x,
          canvas.getHeight() - fingerPos.y,
          paint);
    }

    // draw the rubbish------------------------------------------//
    for (int i = 0; i < totalDragged; ++i) {
      if (rubbishPile.get(i).GetActive()) rubbishPile.get(i).Draw(canvas);
    }

    paint.setARGB(255, 255, 0, 0);
    paint.setStrokeWidth(120); // how thick you want the text to be in terms of pixel
    paint.setTextSize(60);
    canvas.drawText("Active: " + totalDragged, 130, 80, paint);

    bound.DrawDebug(canvas);
  }