diff options
| author | jmoenig <jens@moenig.org> | 2014-03-31 13:09:31 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-03-31 13:09:31 +0200 |
| commit | 6fd93533ecb01c27589bfe569d8e22013a77f65c (patch) | |
| tree | 7b3a10d3bad111150b7e040b7e08552e84c41aa2 | |
| parent | ca9445c245d6c36f9a53ff3afeef47ff6920b59b (diff) | |
| download | snap-byow-6fd93533ecb01c27589bfe569d8e22013a77f65c.tar.gz snap-byow-6fd93533ecb01c27589bfe569d8e22013a77f65c.zip | |
display costume thumbnails in speech/thought/value bubbles and watcher cells
| -rw-r--r-- | blocks.js | 8 | ||||
| -rwxr-xr-x | history.txt | 1 | ||||
| -rw-r--r-- | objects.js | 12 |
3 files changed, 20 insertions, 1 deletions
@@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2014-February-11'; +modules.blocks = '2014-March-31'; var SyntaxElementMorph; @@ -1635,6 +1635,12 @@ SyntaxElementMorph.prototype.showBubble = function (value) { morphToShow.silentSetWidth(img.width); morphToShow.silentSetHeight(img.height); morphToShow.image = img; + } else if (value instanceof Costume) { + img = value.thumbnail(new Point(40, 40)); + morphToShow = new Morph(); + morphToShow.silentSetWidth(img.width); + morphToShow.silentSetHeight(img.height); + morphToShow.image = img; } else if (value instanceof Context) { img = value.image(); morphToShow = new Morph(); diff --git a/history.txt b/history.txt index 4c4201e..1399ba6 100755 --- a/history.txt +++ b/history.txt @@ -2107,3 +2107,4 @@ ______ 140331 ------ * Objects: experimental “wardrobe” and “jukebox” reporters in dev mode +* Blocks, Objects: display costume thumbnails in speech/thought/value bubbles and watcher cells @@ -5058,6 +5058,12 @@ SpriteBubbleMorph.prototype.dataAsMorph = function (data) { contents.silentSetWidth(img.width); contents.silentSetHeight(img.height); contents.image = img; + } else if (data instanceof Costume) { + img = data.thumbnail(new Point(40, 40)); + contents = new Morph(); + contents.silentSetWidth(img.width); + contents.silentSetHeight(img.height); + contents.image = img; } else if (data instanceof HTMLCanvasElement) { contents = new Morph(); contents.silentSetWidth(data.width); @@ -5900,6 +5906,12 @@ CellMorph.prototype.drawNew = function () { this.contentsMorph.silentSetWidth(img.width); this.contentsMorph.silentSetHeight(img.height); this.contentsMorph.image = img; + } else if (this.contents instanceof Costume) { + img = this.contents.thumbnail(new Point(40, 40)); + this.contentsMorph = new Morph(); + this.contentsMorph.silentSetWidth(img.width); + this.contentsMorph.silentSetHeight(img.height); + this.contentsMorph.image = img; } else if (this.contents instanceof List) { if (this.isCircular()) { this.contentsMorph = new TextMorph( |
