pop

概要

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

[p5.js] 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

構文

戻値