Pārlūkot izejas kodu

Viewport: rename method

customisations
alemart 1 gadu atpakaļ
vecāks
revīzija
cae7c45661
3 mainītis faili ar 20 papildinājumiem un 23 dzēšanām
  1. 10
    12
      docs/api/viewport.md
  2. 1
    1
      src/core/stats-panel.ts
  3. 9
    10
      src/core/viewport.ts

+ 10
- 12
docs/api/viewport.md Parādīt failu

86
 
86
 
87
 *Since:* 0.2.1
87
 *Since:* 0.2.1
88
 
88
 
89
+### fullscreenAvailable
90
+
91
+`viewport.fullscreenAvailable: boolean, read-only`
92
+
93
+Checks the availability of the fullscreen mode on the current platform and page.
94
+
95
+*Since:* 0.2.1
96
+
97
+
98
+
89
 ## Methods
99
 ## Methods
90
 
100
 
91
 ### requestFullscreen
101
 ### requestFullscreen
135
 
145
 
136
 A promise that is resolved once the fullscreen mode is no longer active, or rejected on error. The promise will be rejected if the method is called when not in fullscreen mode.
146
 A promise that is resolved once the fullscreen mode is no longer active, or rejected on error. The promise will be rejected if the method is called when not in fullscreen mode.
137
 
147
 
138
-### isFullscreenAvailable
139
-
140
-`viewport.isFullscreenAvailable(): boolean`
141
-
142
-Checks the availability of the fullscreen mode on the current platform and page.
143
-
144
-*Since:* 0.2.1
145
-
146
-**Returns**
147
-
148
-Returns `true` if the fullscreen mode can be activated.
149
-
150
 ## Events
148
 ## Events
151
 
149
 
152
 A viewport is an [AREventTarget](ar-event-target.md). You can listen to the following events:
150
 A viewport is an [AREventTarget](ar-event-target.md). You can listen to the following events:

+ 1
- 1
src/core/stats-panel.ts Parādīt failu

208
         print('<br>');
208
         print('<br>');
209
         print('OUT: <span class="_ar_out"></span>');
209
         print('OUT: <span class="_ar_out"></span>');
210
 
210
 
211
-        if(this._viewport.isFullscreenAvailable()) {
211
+        if(this._viewport.fullscreenAvailable) {
212
             print('<br>');
212
             print('<br>');
213
             container.appendChild(this._createFullscreenToggle());
213
             container.appendChild(this._createFullscreenToggle());
214
         }
214
         }

+ 9
- 10
src/core/viewport.ts Parādīt failu

393
     }
393
     }
394
 
394
 
395
     /**
395
     /**
396
-     * Is the fullscreen mode available?
396
+     * Is the fullscreen mode available in this platform?
397
      * @returns true if the fullscreen mode is available in this platform
397
      * @returns true if the fullscreen mode is available in this platform
398
      */
398
      */
399
     isAvailable(): boolean
399
     isAvailable(): boolean
826
     }
826
     }
827
 
827
 
828
     /**
828
     /**
829
+     * Is the fullscreen mode available in this platform?
830
+     */
831
+    get fullscreenAvailable(): boolean
832
+    {
833
+        return this._fullscreen.isAvailable();
834
+    }
835
+
836
+    /**
829
      * The canvas on which the virtual scene will be drawn
837
      * The canvas on which the virtual scene will be drawn
830
      */
838
      */
831
     get canvas(): HTMLCanvasElement
839
     get canvas(): HTMLCanvasElement
879
     }
887
     }
880
 
888
 
881
     /**
889
     /**
882
-     * Is the fullscreen mode available?
883
-     * @returns true if the fullscreen mode is available in this platform
884
-     */
885
-    isFullscreenAvailable(): boolean
886
-    {
887
-        return this._fullscreen.isAvailable();
888
-    }
889
-
890
-    /**
891
      * Initialize the viewport (when the session starts)
890
      * Initialize the viewport (when the session starts)
892
      * @internal
891
      * @internal
893
      */
892
      */

Notiek ielāde…
Atcelt
Saglabāt