diff options
| author | jmoenig <jens@moenig.org> | 2015-01-21 12:18:46 +0100 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2015-01-21 12:18:46 +0100 |
| commit | fee92b65f292ee46b83cc499bf623eb269dc6565 (patch) | |
| tree | 9c2eef2034ad0c08ce7d3cbfd4a324869360478e | |
| parent | f1fbb38b8715639e6025c130de70ef269cb0c0cd (diff) | |
| download | snap-fee92b65f292ee46b83cc499bf623eb269dc6565.tar.gz snap-fee92b65f292ee46b83cc499bf623eb269dc6565.zip | |
Generate ScriptsPaneTexture programmatically
| -rw-r--r-- | byob.js | 4 | ||||
| -rw-r--r-- | gui.js | 24 | ||||
| -rwxr-xr-x | history.txt | 1 | ||||
| -rw-r--r-- | manifest.mf | 3 | ||||
| -rwxr-xr-x | scriptsPaneTexture.gif | bin | 155 -> 0 bytes | |||
| -rw-r--r-- | store.js | 4 |
6 files changed, 26 insertions, 10 deletions
@@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2015-January-13'; +modules.byob = '2015-January-21'; // Declarations @@ -1651,7 +1651,7 @@ BlockEditorMorph.prototype.init = function (definition, target) { scripts = new ScriptsMorph(target); scripts.isDraggable = false; scripts.color = IDE_Morph.prototype.groupColor; - scripts.texture = IDE_Morph.prototype.scriptsPaneTexture; + scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture; scripts.cleanUpMargin = 10; proto = new PrototypeHatBlockMorph(this.definition); @@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2015-January-13'; +modules.gui = '2015-January-21'; // Declarations @@ -119,7 +119,7 @@ IDE_Morph.prototype.setDefaultDesign = function () { ]; IDE_Morph.prototype.rotationStyleColors = IDE_Morph.prototype.tabColors; IDE_Morph.prototype.appModeColor = new Color(); - IDE_Morph.prototype.scriptsPaneTexture = 'scriptsPaneTexture.gif'; + IDE_Morph.prototype.scriptsPaneTexture = this.scriptsTexture(); IDE_Morph.prototype.padding = 5; SpriteIconMorph.prototype.labelColor @@ -172,6 +172,22 @@ IDE_Morph.prototype.setFlatDesign = function () { = IDE_Morph.prototype.buttonLabelColor; }; +IDE_Morph.prototype.scriptsTexture = function () { + var pic = newCanvas(new Point(100, 100)), // bigger scales faster + ctx = pic.getContext('2d'), + i; + for (i = 0; i < 100; i += 4) { + ctx.fillStyle = this.frameColor.toString(); + ctx.fillRect(i, 0, 1, 100); + ctx.fillStyle = this.groupColor.lighter(6).toString(); + ctx.fillRect(i + 1, 0, 1, 100); + ctx.fillRect(i + 3, 0, 1, 100); + ctx.fillStyle = this.groupColor.toString(); + ctx.fillRect(i + 2, 0, 1, 100); + } + return pic; +}; + IDE_Morph.prototype.setDefaultDesign(); // IDE_Morph instance creation: @@ -1152,7 +1168,7 @@ IDE_Morph.prototype.createSpriteEditor = function () { if (this.currentTab === 'scripts') { scripts.isDraggable = false; scripts.color = this.groupColor; - scripts.texture = this.scriptsPaneTexture; + scripts.cachedTexture = this.scriptsPaneTexture; this.spriteEditor = new ScrollFrameMorph( scripts, @@ -3527,7 +3543,7 @@ IDE_Morph.prototype.userSetBlocksScale = function () { sample = new FrameMorph(); sample.acceptsDrops = false; - sample.texture = this.scriptsPaneTexture; + sample.cachedTexture = this.scriptsPaneTexture; sample.setExtent(new Point(250, 180)); scrpt.setPosition(sample.position().add(10)); sample.add(scrpt); diff --git a/history.txt b/history.txt index 1880e45..ff472c7 100755 --- a/history.txt +++ b/history.txt @@ -2422,3 +2422,4 @@ ______ 150121 ------ * Objects: Keep layering of nested sprites thru drag & drop +* GUI, Store, BYOB: Generate ScriptsPaneTexture programmatically diff --git a/manifest.mf b/manifest.mf index 353d47f..d040961 100644 --- a/manifest.mf +++ b/manifest.mf @@ -10,5 +10,4 @@ threads.js widgets.js store.js xml.js -scriptsPaneTexture.gif -snap_logo_sm.gif +snap_logo_sm.png diff --git a/scriptsPaneTexture.gif b/scriptsPaneTexture.gif Binary files differdeleted file mode 100755 index 846c77f..0000000 --- a/scriptsPaneTexture.gif +++ /dev/null @@ -61,7 +61,7 @@ SyntaxElementMorph, Variable*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2015-January-12'; +modules.store = '2015-January-21'; // XML_Serializer /////////////////////////////////////////////////////// @@ -861,7 +861,7 @@ SnapSerializer.prototype.loadScripts = function (scripts, model) { // private var myself = this, scale = SyntaxElementMorph.prototype.scale; - scripts.texture = 'scriptsPaneTexture.gif'; + scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture; model.children.forEach(function (child) { var element; if (child.tag === 'script') { |
