Sfoglia il codice sorgente

Fix to the screenshot function so it uses the correct scene.

Daniel Eriksson 10 anni fa
parent
commit
feb175ae44
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      Babylon/Tools/babylon.tools.ts

+ 2 - 2
Babylon/Tools/babylon.tools.ts

@@ -461,8 +461,8 @@
             }
 
             //At this point size can be a number, or an object (according to engine.prototype.createRenderTargetTexture method)
-            var texture = new RenderTargetTexture("screenShot", size, engine.scenes[0], false, false);
-            texture.renderList = engine.scenes[0].meshes;
+            var texture = new RenderTargetTexture("screenShot", size, scene, false, false);
+            texture.renderList = scene.meshes;
 
             texture.onAfterRender = () => {
                 // Read the contents of the framebuffer