Permalink
Browse files

starting on text support - moving from experimental

  • Loading branch information...
Dan Newcome
Dan Newcome committed Mar 9, 2012
1 parent bd66f98 commit aa47de0d5ec9ab0aa419c59b4757602370a154b6
Showing with 12 additions and 1 deletion.
  1. +1 −1 build.sh
  2. +11 −0 text.js
View
@@ -1,2 +1,2 @@
#!/bin/bash
-cat donatello.js rect.js circle.js ellipse.js arc.js line.js | uglifyjs > build/donatello-min.js
+cat donatello.js rect.js circle.js ellipse.js arc.js line.js text.js | uglifyjs > build/donatello-min.js
View
11 text.js
@@ -0,0 +1,11 @@
+/**
+* Draw text to the scene using a <div> tag.
+*/
+Donatello.prototype.text = function( x, y, str, a ) {
+ var el = Donatello.createElement( x, y, null, null, 'div');
+ el.innerHTML = str;
+ this.dom.appendChild( el );
+ var don = new Donatello( el );
+ don.attr( a );
+ return don;
+}

0 comments on commit aa47de0

Please sign in to comment.