(p5element).height

def setup
  background(220)
  button = createButton("sample").position(10, 10)
  text("w: #{button.width}", 20, 55)
  text("h: #{button.height}", 20, 75)
end

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

[p5.js] (p5.Element).height

概要

HTML要素の高さの値(単位:ピクセル)が格納されているシステム変数です。

書式

obj.height

備考

・このシステム変数は読み取り専用です。
 HTML要素のサイズを設定する場合は sizeメソッドを使用してください)

関連

(p5element).size
(p5element).width