0
0

More than 3 years have passed since last update.

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

Last updated at Posted at 2020-05-10

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

fullscreen()

説明文

引数を指定した場合、引数の値に基づいてスケッチを全画面表示にするかどうかを設定します。引数が指定されていない場合、現在のフルスクリーン状態を返します。ブラウザの制限により、これはユーザー入力時にのみ呼び出すことができることに注意してください。たとえば、以下の例のようにマウスを押したときだけです。

構文

fullscreen([val])

パラメタ

  • val
    Boolean:スケッチを全画面モードにするかどうか(オプション)

戻り値

  • Boolean:現在の全画面の状態

//ボックスをクリックすると, 全画面表示のオンとオフが切り替わります。
function setup() {
  background(200);
}

function mousePressed() {
  if(mouseX> 0 && mouseX <100 && mouseY> 0 && mouseY <100){
    fs = fullscreen() ;
    fullscreen(fs);
  }
}

実行結果

著作権

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