diff options
| author | Viraj Mahesh <virajmahesh@gmail.com> | 2014-02-25 16:18:20 -0800 |
|---|---|---|
| committer | Viraj Mahesh <virajmahesh@gmail.com> | 2014-02-25 16:18:20 -0800 |
| commit | dc4e9a5c1c4a0d3bc7a585bf6f8878dee830d040 (patch) | |
| tree | 3647fe18b4873a67c10cc517b641a2c7f476f209 /objects.js | |
| parent | 8badce6480d434653326684a953fccc6cf03c5d8 (diff) | |
| download | snap-dc4e9a5c1c4a0d3bc7a585bf6f8878dee830d040.tar.gz snap-dc4e9a5c1c4a0d3bc7a585bf6f8878dee830d040.zip | |
Screenshts are saved as costumes of the current sprite
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -809,6 +809,11 @@ SpriteMorph.prototype.initBlocks = function () { category: 'sensing', spec: 'current %dates' }, + doScreenshot: { + type: 'command', + category: 'sensing', + spec: 'save a screenshot to' + }, // Operators reifyScript: { @@ -1746,6 +1751,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportIsFastTracking')); blocks.push(block('doSetFastTracking')); blocks.push('-'); + blocks.push(block('doScreenshot')); blocks.push(block('reportDate')); // for debugging: /////////////// @@ -3696,6 +3702,12 @@ SpriteMorph.prototype.reactToDropOf = function (morph, hand) { morph.slideBackTo(hand.grabOrigin); }; +SpriteMorph.prototype.doScreenshot = function() { + console.log('Testing screenshot'); + var parent = this.parentThatIsA(StageMorph); + var image = parent.fullImageClassic(); +}; + // SpriteHighlightMorph ///////////////////////////////////////////////// // SpriteHighlightMorph inherits from Morph: @@ -3775,7 +3787,7 @@ StageMorph.prototype.init = function (globals) { this.blocksCache = {}; // not to be serialized (!) this.paletteCache = {}; // not to be serialized (!) this.lastAnswer = null; // last user input, do not persist - this.activeSounds = []; // do not persist + this.active = []; // do not persist this.trailsCanvas = null; this.isThreadSafe = false; @@ -4694,6 +4706,7 @@ StageMorph.prototype.userMenu = function () { menu.addItem( "pic...", function () { + //console.log(myself.fullImageClassic().toDataURL()); window.open(myself.fullImageClassic().toDataURL()); }, 'open a new window\nwith a picture of the stage' |
