createElement

def setup
  background(220)
  h5 = createElement('h5', 'im an h5 p5.element!')
  h5.style('color', '#00a1d3')
  h5.position(0, 0)
end

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

[p5.js] createElement

概要

指定されたタグの HTMLエレメントを生成します。

書式

createElement(tag [, content])

引数

引数名内容備考オプションデフォルト値
tagHTMLエレメントのタグ
contentHTMLコンテンツHTMLエレメントに挿入""

戻値

p5.Elementオブジェクト

備考

関連