ronin/scripts/modules/file.save.js
Devine Lu Linvega 859c834026 Needs body
2017-01-07 08:39:48 -07:00

21 lines
616 B
JavaScript

function FileSave(rune)
{
Module.call(this,rune);
this.parameters = [Any];
this.active = function(cmd)
{
var n = "Ronin Export";
var f = cmd.variable("format");
var d = ronin.surface.merge();
d = ronin.surface.layers["render"].element.toDataURL('image/png');
ronin.surface.layers["render"].clear();
var w = window.open('about:blank','image from canvas');
w.document.write("<title>"+(n ? n : "Untitled")+"</title><body><img src='"+d+"' width='"+ronin.surface.size.width+"px' height='"+ronin.surface.size.height+"px'/></body>");
}
this.passive = function(cmd)
{
}
}