Hi everyone!
I was trying to understand how krpano.webGL.makeScreenshot() works (with my almost zero JavaScript knowledge, heh).
I took an example code from here: https://krpano.com/docu/plugininterface/#js and adapted it a bit:
1) Added action for the plugin
// add plugin action (the attribute needs to be lowercase!) plugin.dosomething = make_screenshot;
2) and the action itself:
function make_screenshot() { // trace krpano.trace(1, krpano.webGL); krpano.call("showlog();"); krpano.webGL.makeScreenshot(500, 300); }
3) In the xml I have this plugin code:
<plugin name="screenshot_plugin" url="screenshot.js" keep="true" align="center" onclick="dosomething();" />
4) and in the html file I added 'preserveDrawingBuffer' setting to the embedding parameters https://krpano.com/docu/html/#webglsettings :
<script> embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano", html5:"auto", mobilescale:1.0, passQueryParameters:true, webglsettings:{preserveDrawingBuffer:true}}); </script>
The result is that plugin loads OK, 'says' 'hello from the plugin' and when clicked, it shows Krpano log, traces krpano.WebGL (result is [object Object]), but I don't (or can't) see any screenshot created.
I wonder, what am I doing wrong here or maybe the indended use of https://krpano.com/docu/pluginint….makeScreenshot is quite different?