createButton

概要

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

[p5.js] createButton

サンプル

def setup
  createCanvas(100, 100)
  background(0)
  button = createButton('click me')
  button.position(0, 0)
  changeBG = Proc.new {
    val = rand(255)
    background(val)
  }
  button.mousePressed(changeBG)
end

構文

戻値