ronin/scripts/modules/file.save.js
2017-01-11 10:11:38 -07:00

22 lines
651 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.active_layer.element.toDataURL('image/png');
// // ronin.surface.layers["render"].clear();
var w = window.open('about:blank','image from canvas');
// w.document.write("hello")
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)
{
}
}