summaryrefslogtreecommitdiffstats
path: root/source/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'source/ui.js')
-rw-r--r--source/ui.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/ui.js b/source/ui.js
index b63d632..b2e9441 100644
--- a/source/ui.js
+++ b/source/ui.js
@@ -224,6 +224,17 @@ if (typeof jQuery !== 'undefined') {
},
/*
+ *
+ * nes.ui.screenshot() --> return <img> element :)
+ */
+ screenshot: function() {
+ var data = this.screen[0].toDataURL("image/png"),
+ img = new Image();
+ img.src = data;
+ return img;
+ },
+
+ /*
* Enable and reset UI elements
*/
enable: function() {