瀏覽代碼

Remove the Watermark for now

customisations
alemart 3 月之前
父節點
當前提交
b2f689ab3e
共有 5 個文件被更改,包括 3 次插入252 次删除
  1. 0
    1
      docs/api/viewport.md
  2. 1
    15
      plugins/aframe-with-encantar.js
  3. 1
    9
      src/core/hud.ts
  4. 1
    6
      src/core/viewport.ts
  5. 0
    221
      src/ui/watermark.ts

+ 0
- 1
docs/api/viewport.md 查看文件

@@ -19,7 +19,6 @@ Create a new viewport with the specified `settings`.
19 19
     * `canvas: HTMLCanvasElement, optional`. An existing canvas on which the virtual scene will be drawn. The engine automatically creates a canvas. You should only specify an existing canvas if you must. Experimental.
20 20
     * `style: string, optional`. The [viewport style](#style). *Since:* 0.3.0
21 21
     * `fullscreenUI: boolean, optional`. Whether or not to include, as a convenience, the built-in fullscreen button on platforms in which the fullscreen mode is [available](#fullscreenavailable). Defaults to `true`. *Since:* 0.3.0
22
-    * `watermark: boolean, optional`. Whether or not to display the encantar.js watermark and the accompanying about box. *Since:* 0.4.4
23 22
 
24 23
 **Returns**
25 24
 

+ 1
- 15
plugins/aframe-with-encantar.js 查看文件

@@ -1064,7 +1064,6 @@ AFRAME.registerComponent('ar-viewport', ARComponent({
1064 1064
         const scene = this.el.sceneEl;
1065 1065
         const huds = [];
1066 1066
         const fullscreenUI = this.el.components['ar-viewport-fullscreen-ui'];
1067
-        const watermark = this.el.components['ar-viewport-watermark'];
1068 1067
 
1069 1068
         for(const child of this.el.children) {
1070 1069
             if(child.components !== undefined) {
@@ -1089,8 +1088,7 @@ AFRAME.registerComponent('ar-viewport', ARComponent({
1089 1088
                 resolution: this.data.resolution,
1090 1089
                 style: this.data.style,
1091 1090
             },
1092
-            !fullscreenUI ? {} : { fullscreenUI: fullscreenUI.data.enabled },
1093
-            !watermark ? {} : { watermark: watermark.data.visible }
1091
+            !fullscreenUI ? {} : { fullscreenUI: fullscreenUI.data.enabled }
1094 1092
         ));
1095 1093
     },
1096 1094
 
@@ -1104,7 +1102,6 @@ AFRAME.registerPrimitive('ar-viewport', {
1104 1102
         'resolution': 'ar-viewport.resolution',
1105 1103
         'style': 'ar-viewport.style',
1106 1104
         'fullscreen-ui': 'ar-viewport-fullscreen-ui',
1107
-        'watermark': 'ar-viewport-watermark'
1108 1105
     }
1109 1106
 });
1110 1107
 
@@ -1119,17 +1116,6 @@ AFRAME.registerComponent('ar-viewport-fullscreen-ui', ARComponent({
1119 1116
 
1120 1117
 }));
1121 1118
 
1122
-AFRAME.registerComponent('ar-viewport-watermark', ARComponent({
1123
-
1124
-    schema: {
1125
-
1126
-        /** whether or not to display the encantar.js watermark */
1127
-        'visible': { type: 'boolean', default: true },
1128
-
1129
-    }
1130
-
1131
-}));
1132
-
1133 1119
 /**
1134 1120
  * AR Heads-Up Display
1135 1121
  */

+ 1
- 9
src/core/hud.ts 查看文件

@@ -23,7 +23,6 @@
23 23
 import { Viewport } from './viewport';
24 24
 import { StatsPanel } from '../ui/stats-panel';
25 25
 import { FullscreenButton } from '../ui/fullscreen-button';
26
-import { Watermark } from '../ui/watermark';
27 26
 import { Nullable, Utils } from '../utils/utils';
28 27
 
29 28
 /** HUD container */
@@ -49,9 +48,6 @@ export class HUD
49 48
     /** Fullscreen button */
50 49
     #fullscreenButton: FullscreenButton;
51 50
 
52
-    /** Watermark */
53
-    #watermark: Watermark;
54
-
55 51
 
56 52
 
57 53
 
@@ -85,7 +81,6 @@ export class HUD
85 81
         // create internal components
86 82
         this.#statsPanel = new StatsPanel();
87 83
         this.#fullscreenButton = new FullscreenButton(viewport);
88
-        this.#watermark = new Watermark();
89 84
     }
90 85
 
91 86
     /**
@@ -128,15 +123,13 @@ export class HUD
128 123
      * @param zIndex the z-index of the container
129 124
      * @param wantStatsPanel
130 125
      * @param wantFullscreenButton
131
-     * @param wantWatermark
132 126
      * @internal
133 127
      */
134
-    _init(zIndex: number, wantStatsPanel: boolean, wantFullscreenButton: boolean, wantWatermark: boolean): void
128
+    _init(zIndex: number, wantStatsPanel: boolean, wantFullscreenButton: boolean): void
135 129
     {
136 130
         const parent = this._internalContainer;
137 131
         this.#statsPanel.init(parent, wantStatsPanel);
138 132
         this.#fullscreenButton.init(parent, wantFullscreenButton);
139
-        this.#watermark.init(parent, wantWatermark);
140 133
 
141 134
         for(const element of parent.children as any as HTMLElement[]) {
142 135
             if(element.style.getPropertyValue('pointer-events') == '')
@@ -164,7 +157,6 @@ export class HUD
164 157
     {
165 158
         this._visible = false;
166 159
 
167
-        this.#watermark.release();
168 160
         this.#fullscreenButton.release();
169 161
         this.#statsPanel.release();
170 162
 

+ 1
- 6
src/core/viewport.ts 查看文件

@@ -76,9 +76,6 @@ export interface ViewportSettings
76 76
 
77 77
     /** Whether or not to include the built-in fullscreen button */
78 78
     fullscreenUI?: boolean;
79
-
80
-    /** Whether or not to display the encantar.js watermark */
81
-    watermark?: boolean;
82 79
 }
83 80
 
84 81
 /** Default viewport constructor settings */
@@ -89,7 +86,6 @@ const DEFAULT_VIEWPORT_SETTINGS: Readonly<Required<ViewportSettings>> = {
89 86
     style: 'best-fit',
90 87
     canvas: null,
91 88
     fullscreenUI: true,
92
-    watermark: true,
93 89
 };
94 90
 
95 91
 
@@ -1231,8 +1227,7 @@ export class Viewport extends AREventTarget<ViewportEvent>
1231 1227
 
1232 1228
         // initialize the HUD
1233 1229
         const wantFullscreenButton = this.fullscreenAvailable && this._settings.fullscreenUI;
1234
-        const wantWatermark = this._settings.watermark;
1235
-        this._hud._init(HUD_ZINDEX, wantStatsPanel, wantFullscreenButton, wantWatermark);
1230
+        this._hud._init(HUD_ZINDEX, wantStatsPanel, wantFullscreenButton);
1236 1231
     }
1237 1232
 
1238 1233
     /**

+ 0
- 221
src/ui/watermark.ts
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存