diff options
author | Ben Firshman <ben@firshman.co.uk> | 2013-09-16 06:41:46 -0700 |
---|---|---|
committer | Ben Firshman <ben@firshman.co.uk> | 2013-09-16 06:41:46 -0700 |
commit | 62822838d3e15ef541b0074f20183d1311ea578b (patch) | |
tree | 0b54f089f21a7eb92656b4416132af04b5b26a0c /source/ui.js | |
parent | 7ad5da88e9af9e4bcef5aabc64ca52f344dc685a (diff) | |
parent | 3313030bbbd6d05019aff5e426b67621981d6312 (diff) | |
download | jsnes-62822838d3e15ef541b0074f20183d1311ea578b.zip jsnes-62822838d3e15ef541b0074f20183d1311ea578b.tar.gz jsnes-62822838d3e15ef541b0074f20183d1311ea578b.tar.bz2 |
Merge pull request #33 from yasaricli/master
ui game add screenshot method.
Diffstat (limited to 'source/ui.js')
-rw-r--r-- | source/ui.js | 11 |
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() { |