pmouseY

def draw
  background(237, 34, 93)
  fill(0)
  # draw a square only if the mouse is not moving
  if mouseY == pmouseY && mouseX == pmouseX
    rect(20, 20, 60, 60)
  end
end

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

[p5.js] pmouseY

概要

マウスポインタの1フレーム前の y座標の値が格納されているシステム変数です。

書式

pmouseY

備考

関連