This is my screeshot code
private screenShot():void{
var gui = AdvancedDynamicTexture.CreateFullscreenUI("UI");
var btnScreenshot = Button.CreateSimpleButton("but1", "截图");
console.log(btnScreenshot)
btnScreenshot.left = '300px'
btnScreenshot.background ='red'
btnScreenshot.width = "150px"
btnScreenshot.height = "40px";
btnScreenshot.color = "white";
btnScreenshot.onPointerUpObservable.add(()=> {
Tools.CreateScreenshotUsingRenderTarget(this.engine, this.camera, {
width:240,
height:400,
precision: 5.5
},
function (data) {
console.log(data)
});
});
gui.addControl(btnScreenshot);
}
This is playground https://www.babylonjs-playground.com/#BGICGY#2 , When you zoom in and out, the screenshot will be incomplete