Browse Source

clearColor is optional

as can be seen on line 70, clearColor can be undefined (or null), so TS optional flag fits nicely.
Raanan Weber 10 năm trước cách đây
mục cha
commit
e49ec7b031
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/Materials/Textures/babylon.dynamicTexture.ts

+ 2 - 2
src/Materials/Textures/babylon.dynamicTexture.ts

@@ -65,7 +65,7 @@
             this.getScene().getEngine().updateDynamicTexture(this._texture, this._canvas, invertY === undefined ? true : invertY);
         }
 
-        public drawText(text: string, x: number, y: number, font: string, color: string, clearColor: string, invertY?: boolean, update = true) {
+        public drawText(text: string, x: number, y: number, font: string, color: string, clearColor?: string, invertY?: boolean, update = true) {
             var size = this.getSize();
             if (clearColor) {
                 this._context.fillStyle = clearColor;
@@ -101,4 +101,4 @@
             return newTexture;
         }
     }
-} 
+}