コード例 #1
0
  /**
   * Prepare one animation step.
   *
   * @param d draw surface
   * @param dt time passed since last move
   */
  public void doOneFrame(DrawSurface d, double dt) {
    Color backgColor = new Color(205, 252, 228);
    Color textColor = new Color(51, 175, 150);

    // Draw background
    new Rectangle(0, 0, d.getWidth(), d.getHeight(), backgColor).drawOn(d);

    // Draw text
    d.setColor(textColor);
    String stopKey = Finals.getInstance().getStopAnimationKey();
    d.drawText(180, 80, "Paused. Press " + stopKey + " to continue", 30);
  }
コード例 #2
0
ファイル: Ball.java プロジェクト: ZlotnikYv/src
 /** @param surface to draw the ball on draw the ball on the given DrawSurface */
 public void drawOn(DrawSurface surface) {
   surface.setColor(this.color);
   surface.fillCircle((int) this.center.getX(), (int) this.center.getY(), this.r);
 }