pop

def setup
  background(220)
  ellipse(0, 50, 33, 33)     # Left circle
  push                       # Start a new drawing state
  strokeWeight(10)
  fill(204, 153, 0)
  translate(50, 0)
  ellipse(0, 50, 33, 33)     # Middle circle
  pop                        # Restore original state
  ellipse(100, 50, 33, 33)   # Right circle
end
def setup
  background(220)
  ellipse(0, 50, 33, 33)     # Left circle
  push                       # Start a new drawing state
  strokeWeight(10)
  fill(204, 153, 0)
  ellipse(33, 50, 33, 33)    # Left-middle circle
  push                       # Start another new drawing state
  stroke(0, 102, 153)
  ellipse(66, 50, 33, 33)    # Right-middle circle
  pop                        # Restore previous state
  pop                        # Restore original state
  ellipse(100, 50, 33, 33)   # Right circle
end

p5.jsリファレンス(参考情報)

[p5.js] pop

概要

pushメソッドによって保存された描画スタイルや座標系などの設定を復元します。

書式

pop

引数

なし

戻値

なし

備考

関連

push