Selaa lähdekoodia

Update monacoManager.ts

re-add canvas parameter to attachControl for examples, for backcompat
aWeirdo 4 vuotta sitten
vanhempi
commit
a51091db96
1 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. 4 5
      Playground/src/tools/monacoManager.ts

+ 4 - 5
Playground/src/tools/monacoManager.ts

@@ -136,7 +136,7 @@ var createScene = function() {
     camera.setTarget(BABYLON.Vector3.Zero());
     camera.setTarget(BABYLON.Vector3.Zero());
 
 
     // This attaches the camera to the canvas
     // This attaches the camera to the canvas
-    camera.attachControl(true);
+    camera.attachControl(canvas, true);
 
 
     return scene;
     return scene;
 };`);
 };`);
@@ -155,7 +155,7 @@ class Playground {
         camera.setTarget(BABYLON.Vector3.Zero());
         camera.setTarget(BABYLON.Vector3.Zero());
 
 
         // This attaches the camera to the canvas
         // This attaches the camera to the canvas
-        camera.attachControl(true);
+        camera.attachControl(canvas, true);
 
 
         return scene;
         return scene;
     }
     }
@@ -287,7 +287,7 @@ class Playground {
     camera.setTarget(BABYLON.Vector3.Zero());
     camera.setTarget(BABYLON.Vector3.Zero());
 
 
     // This attaches the camera to the canvas
     // This attaches the camera to the canvas
-    camera.attachControl(true);
+    camera.attachControl(canvas, true);
 
 
     // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
     // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
     var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
     var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
@@ -305,7 +305,6 @@ class Playground {
     var ground = BABYLON.MeshBuilder.CreateGround("ground", {width: 6, height: 6}, scene);
     var ground = BABYLON.MeshBuilder.CreateGround("ground", {width: 6, height: 6}, scene);
 
 
     return scene;
     return scene;
-
 };`);
 };`);
         } else {
         } else {
             this._editor.setValue(`class Playground {
             this._editor.setValue(`class Playground {
@@ -320,7 +319,7 @@ class Playground {
         camera.setTarget(BABYLON.Vector3.Zero());
         camera.setTarget(BABYLON.Vector3.Zero());
 
 
         // This attaches the camera to the canvas
         // This attaches the camera to the canvas
-        camera.attachControl(true);
+        camera.attachControl(canvas, true);
 
 
         // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
         // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
         var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
         var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);