LoginSignup
1
0

More than 3 years have passed since last update.

P5.js 日本語リファレンス(pixelDensity)

Last updated at Posted at 2020-05-10

このページでは「P5.js 日本語リファレンス」 の pixelDensity関数を説明します。

pixelDensity()

説明文

高ピクセル密度ディスプレイのピクセルスケーリングを設定します。デフォルトでは、ピクセル密度はディスプレイ密度と一致するように設定されています。これをオフにするには pixelDensity(1) を呼び出します。引数なしで pixelDensity() を呼び出すと、スケッチの現在のピクセル密度が返されます。

構文

pixelDensity(val)

pixelDensity()

パラメタ

  • val
    Number:ピクセルスケーリング値

function setup() {
  pixelDensity(1);
  createCanvas(100, 100);
  background(200);
  ellipse(width / 2, height / 2, 50, 50);
}

実行結果

pixelDensity.png

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0