def setup @pg = createGraphics(80, 50) @pg.background("yellow") end def draw background(220) image(@pg, 10, 10) text("w: #{@pg.width}", 20, 75) text("h: #{@pg.height}", 20, 90) end
[p5.js] p5.Graphics
描画用オブジェクト(グラフィックバッファ)の高さが格納されているプロパティです。