summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-02-28 15:38:59 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-02-28 15:38:59 +0100
commit200cb7423b8952fe7770ce8abed9f3f8383d9a61 (patch)
tree0f4ff867a49f82e026e7f02ec66b317ba129c64c /objects.js
parent3e58dfa573be0ea6acb380ffa98ca8d7db6752a5 (diff)
downloadsnap-yow-200cb7423b8952fe7770ce8abed9f3f8383d9a61.tar.gz
snap-yow-200cb7423b8952fe7770ce8abed9f3f8383d9a61.zip
add popups as speech bubbles
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/objects.js b/objects.js
index 0f0514d..92367f1 100644
--- a/objects.js
+++ b/objects.js
@@ -3176,6 +3176,9 @@ SpriteMorph.prototype.clearEffects = function () {
// SpriteMorph talk bubble
SpriteMorph.prototype.stopTalking = function () {
+ if (window.map.hasLayer(this.popup)) {
+ window.map.removeLayer(this.popup);
+ }
var bubble = this.talkBubble();
if (bubble) {bubble.destroy(); }
};
@@ -3190,6 +3193,13 @@ SpriteMorph.prototype.bubble = function (data, isThought, isQuestion) {
this.stopTalking();
if (data === '' || isNil(data)) {return; }
+
+ // Snap! YOW
+ this.popup = L.popup()
+ .setLatLng([this.yPosition(), this.xPosition()])
+ .setContent(data)
+ .addTo(window.map);
+
bubble = new SpriteBubbleMorph(
data,
stage ? stage.scale : 1,