diff options
| author | jmoenig <jens@moenig.org> | 2013-03-18 12:32:24 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-03-18 12:32:24 +0100 |
| commit | 78ab4de381c5c0d22475f830beeb993199355c22 (patch) | |
| tree | ac916c2da9758db8d2fdc8a489d3a2bbe3bd52f6 /gui.js | |
| parent | 0b510366d230399a38f18a8db92dd396a0dad42e (diff) | |
| download | snap-78ab4de381c5c0d22475f830beeb993199355c22.tar.gz snap-78ab4de381c5c0d22475f830beeb993199355c22.zip | |
Scalable blocks and scripts
Shift-clicking on the settings menu lets you specify a fraction, by
which blocks and scripts are scaled, allowing you to e.g. export
poster-sized hi-res script pics, or to present Snap! live on hi-res
screens and projectors
Diffstat (limited to 'gui.js')
| -rw-r--r-- | gui.js | 56 |
1 files changed, 55 insertions, 1 deletions
@@ -68,7 +68,7 @@ sb*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2013-March-15'; +modules.gui = '2013-March-18'; // Declarations @@ -1687,6 +1687,14 @@ IDE_Morph.prototype.settingsMenu = function () { menu = new MenuMorph(this); menu.addItem('Language...', 'languageMenu'); + if (shiftClicked) { + menu.addItem( + 'Scale blocks...', + 'userSetBlocksScale', + null, + new Color(100, 0, 0) + ); + } menu.addLine(); addPreference( 'Blurred shadows', @@ -2760,6 +2768,52 @@ IDE_Morph.prototype.reflectLanguage = function (lang) { this.openProjectString(projectData); }; +// IDE_Morph blocks scaling + +IDE_Morph.prototype.userSetBlocksScale = function () { + var myself = this; + new DialogBoxMorph( + null, + function (num) { + myself.setBlocksScale(num); + } + ).prompt( + 'Scale Blocks', + SyntaxElementMorph.prototype.scale.toString(), + this.world(), + null, + { + 'normal (1)' : 1, + 'demo (1.2)' : 1.2, + 'big (2)' : 2, + 'huge (4)' : 4, + 'giant (8)' : 8 + }, + false, // read only? + true // numeric + ); +}; + +IDE_Morph.prototype.setBlocksScale = function (num) { + var projectData; + if (Process.prototype.isCatchingErrors) { + try { + projectData = this.serializer.serialize(this.stage); + } catch (err) { + this.showMessage('Serialization failed: ' + err); + } + } else { + projectData = this.serializer.serialize(this.stage); + } + SyntaxElementMorph.prototype.setScale(num); + SpriteMorph.prototype.initBlocks(); + this.spriteBar.tabBar.tabTo('scripts'); + this.createCategories(); + this.createCorralBar(); + this.fixLayout(); + this.openProjectString(projectData); +}; + // IDE_Morph cloud interface IDE_Morph.prototype.initializeCloud = function () { |
