code-dot-org/blockly — pull request #531 by cpirich (2014-04-30 02:01:59+00:00)
Title: [#70103500] add v1 speech bubbles

Speech bubbles (in an early form) are now present.
Sadly, text in SVG doesn't wrap automatically, so we have to manually do word breaking. (foreignObject could solve this by placing HTML into SVG, but it doesn't work in IE)
Speech bubbles are now grouped elements with a rect element, a text element, and tspan elements for each line of text inside the text element.
The art for the the bubble is still a basic round rect - better art with the little triangle pointing at the character's mouth is coming in the future.
But the "bubble" and the associated text now stays in the visible area (moving below the sprite or shifting to the left as needed). The text wraps to a maximum of two lines for now. The width of the bubble is fixed (it may shrink with small text in the future). No animation when the bubble appears or disappears at this point.
Text is horizontally centered within the bubble.