Exemple #1
0
  public void UpdateMarker() {
    marker.setTitle(
        (isInvoln() ? "Powered up " : "")
            + PlayerType.getTypeString(type)
            + " "
            + (local ? "You" : name));
    int drawableID = PlayerType.getDrawableID(type);

    Bitmap bmp = BitmapFactory.decodeResource(Game.getAppContext().getResources(), drawableID);

    if (bmp == null) {
      return;
    }

    double aspect = bmp.getWidth() / (double) bmp.getHeight();
    marker.setIcon(
        BitmapDescriptorFactory.fromBitmap(
            Bitmap.createScaledBitmap(bmp, (int) (100 * aspect), 100, false)));
    marker.setAlpha(isCooldown() ? 0.5f : 1f);
    marker.setVisible(true);
    marker.setPosition(new LatLng(latitude, longitude));
    marker.setSnippet("Score: " + score);
    accuracyCircle.setCenter(new LatLng(latitude, longitude));
    accuracyCircle.setRadius(accuracy);
  }