Beispiel #1
0
  /**
   * Applies Camera transformations and draws all the Layers in this World.
   *
   * @param canvas The Canvas onto which the World will be drawn.
   */
  public void draw(Canvas canvas) {

    canvas.save();
    canvas.translate(-camera.getPosition().getX(), -camera.getPosition().getY());

    for (Layer l : layers) {
      l.draw(canvas, camera.getBoundingBox());
    }

    canvas.restore();
  }