Browse Source

A-Frame plugin: rename event to arstarted

customisations
alemart 6 months ago
parent
commit
a2e2ccefc1
2 changed files with 7 additions and 4 deletions
  1. 4
    2
      docs/api/plugin-aframe.md
  2. 3
    2
      plugins/aframe-with-encantar.js

+ 4
- 2
docs/api/plugin-aframe.md View File

448
 
448
 
449
 ## Events
449
 ## Events
450
 
450
 
451
-### ar-started
451
+### arstarted
452
 
452
 
453
-The `ar-started` event is emitted when the main loop of the AR scene is set up, just after the AR session starts.
453
+This event is emitted on the scene when the main loop of the AR scene is set up, just after the AR session starts.
454
+
455
+*Since:* 0.4.2. Previously, this event was called *ar-started*.
454
 
456
 
455
 **Details**
457
 **Details**
456
 
458
 

+ 3
- 2
plugins/aframe-with-encantar.js View File

189
         scene.setAttribute('renderer', { alpha: true });
189
         scene.setAttribute('renderer', { alpha: true });
190
 
190
 
191
         // pause the scene until we're ready
191
         // pause the scene until we're ready
192
-        scene.addEventListener('ar-started', () => {
192
+        scene.addEventListener('arstarted', () => {
193
             scene.play();
193
             scene.play();
194
         });
194
         });
195
         scene.addEventListener('loaded', () => {
195
         scene.addEventListener('loaded', () => {
252
 
252
 
253
             // we're done!
253
             // we're done!
254
             const scene = this.el;
254
             const scene = this.el;
255
-            scene.emit('ar-started', { ar: this });
255
+            scene.emit('arstarted', { ar: this });
256
+            scene.emit('ar-started', { ar: this }); // backwards compatibility with 0.3.0 - 0.4.1
256
             return session;
257
             return session;
257
         })
258
         })
258
         .catch(error => {
259
         .catch(error => {

Loading…
Cancel
Save