threepipe
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

FullScreenPlugin.md 1.1KB

1 ano atrás
12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. prev:
  3. text: 'PickingPlugin'
  4. link: './PickingPlugin'
  5. next:
  6. text: 'AssetExporterPlugin'
  7. link: './AssetExporterPlugin'
  8. ---
  9. # FullScreenPlugin
  10. [//]: # (todo: image)
  11. [Example](https://threepipe.org/examples/#fullscreen-plugin/) —
  12. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/interaction/FullScreenPlugin.ts) —
  13. [API Reference](https://threepipe.org/docs/classes/FullScreenPlugin.html)
  14. A simple plugin that provides functions to enter, exit and toggle full screen mode and check if the viewer is in full screen mode. Either the canvas or the whole container can be set to full screen.
  15. ```typescript
  16. import {ThreeViewer, FullScreenPlugin} from 'threepipe'
  17. const viewer = new ThreeViewer({...})
  18. const fullscreen = viewer.addPluginSync(new FullScreenPlugin())
  19. // enter full screen
  20. await fullscreen.enter(viewer.container) // viewer.canvas is used if no element is passed
  21. // exit full screen
  22. await fullscreen.exit()
  23. // toggle
  24. await fullscreen.toggle(viewer.container)
  25. // check if full screen
  26. console.log(fullScreenPlugin.isFullScreen())
  27. ```