瀏覽代碼

fixed type error on drawText API

Zcating 5 年之前
父節點
當前提交
cf3674d975
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Materials/Textures/dynamicTexture.ts

+ 1 - 1
src/Materials/Textures/dynamicTexture.ts

@@ -146,7 +146,7 @@ export class DynamicTexture extends Texture {
      * @param invertY defines the direction for the Y axis (default is true - y increases downwards)
      * @param update defines whether texture is immediately update (default is true)
      */
-    public drawText(text: string, x: number, y: number, font: string, color: string, clearColor: string, invertY?: boolean, update = true) {
+    public drawText(text: string, x: number | null | undefined, y: number | null | undefined, font: string, color: string, clearColor: string, invertY?: boolean, update = true) {
         var size = this.getSize();
         if (clearColor) {
             this._context.fillStyle = clearColor;