rect

def setup
  background(220)
  rect(20, 30, 65, 50)
end
def setup
  background(220)
  rect(30, 20, 55, 55, 20)
end
def setup
  background(220)
  rect(30, 20, 55, 55, 20, 15, 10, 5)
end

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

[p5.js] rect

概要

矩形を描画します。

書式

rect(x, y, w [, h] [, tl] [, tr] [, br] [, bl])
rect(x, y, w, h [, detailX] [, detailY])

引数

引数名内容備考オプションデフォルト値
x基点の x座標rectModeの設定に依存
y基点の y座標rectModeの設定に依存
wrectModeの設定に依存
h高さrectModeの設定に依存wと同値
tl左上隅の角の丸み0
tr右上隅の角の丸みtlと同値
br右下隅の角の丸みtrと同値
bl左下隅の角の丸みbrと同値
detailXx方向のセグメント数WEBGLモードのキャンバスでのみ有効
detailYx方向のセグメント数WEBGLモードのキャンバスでのみ有効

戻値

なし

備考

・各引数の解釈は rectModeの設定内容に依存します。

関連

rectMode