mouseButton

概要

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

[p5.js] mouseButton

サンプル

def draw
  background(237, 34, 93)
  fill(0)

  if mouseIsPressed
    if mouseButton === LEFT
      ellipse(50, 50, 50, 50)
    end
    if mouseButton == RIGHT
      rect(25, 25, 50, 50)
    end
    if mouseButton == CENTER
      triangle(23, 75, 50, 20, 78, 75)
    end
  end
end

構文

戻値