clear

# Clear the screen on mouse press.
def setup
  background(128)
end

def draw
  ellipse(mouseX, mouseY, 20, 20)
end

def mousePressed
  clear
  background(128)
end

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

[p5.js] clear

概要

キャンバスの描画内容をすべてクリアします。

書式

clear

引数

なし

戻値

なし

備考

・WEBGLモードにおける引数r, g, b, aの指定は未実装です。

関連