Browse Source

Add Watermark

customisations
alemart 3 months ago
parent
commit
3e77570556
2 changed files with 229 additions and 0 deletions
  1. 7
    0
      src/core/hud.ts
  2. 222
    0
      src/ui/watermark.ts

+ 7
- 0
src/core/hud.ts View File

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

+ 222
- 0
src/ui/watermark.ts
File diff suppressed because it is too large
View File


Loading…
Cancel
Save