LoginSignup
0
0

More than 3 years have passed since last update.

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

Last updated at Posted at 2020-05-11

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

drawingContext

説明文

p5.j​​s APIはグラフィックを作成するための多くの機能を提供しますが、p5によって公開されていないネイティブなHTML5 Canvas機能がいくつかあります。次の例のように、変数 drawingContext を使用して直接呼び出すこともできます。これは canvas.getContext('2d') または canvas.getContext('webgl') を呼び出すのと同じです。呼び出すことができる可能な描画関数については, ネイティブキャンバスAPIを参照してください。

構文

drawingContext

function setup() {
  drawingContext.shadowOffsetX = 5;
  drawingContext.shadowOffsetY = -5;
  drawingContext.shadowBlur = 10;
  drawingContext.shadowColor = 'black';
  background(200);
  ellipse(width/ 2, height/ 2, 50, 50);
}

実行結果

drawingContext.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) に従います。

0
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
0
0