Add documentation for `.text()` method.
authorMeitar Moscovitz <meitarm@gmail.com>
Sun, 25 Jan 2009 13:48:18 +0000 (21:48 +0800)
committerDmitry Baranovskiy <dmitry.baranovskiy@gmail.com>
Tue, 27 Jan 2009 04:50:40 +0000 (12:50 +0800)
Signed-off-by: Dmitry Baranovskiy <dmitry.baranovskiy@gmail.com>
README.markdown
reference.html

index 5c18b75..316daef 100644 (file)
@@ -293,6 +293,20 @@ Embeds an image into the SVG/VML canvas.
 
     var c = paper.image("apple.png", 10, 10, 100, 100);
 
+#### text
+
+Draws a text string.
+
+##### Parameters
+
+1. x number X coordinate position
+2. y number Y coordinate position
+3. text string The text string to draw.
+
+##### Usage
+
+    var t = paper.text(10, 10, "Look mom, I'm scalable!");
+
 #### path
 
 Initialises path drawing. Typically, this function returns an empty `path` object and to draw paths you use its built-in methods like `lineTo` and `curveTo`. However, you can also specify a path literally by supplying the path data as a second argument.
index 73a686e..1a6c5a8 100644 (file)
@@ -289,6 +289,20 @@ c.attr({fill: "#000", stroke: "#f00", opacity: 0.5}); // using params object</co
                         </ol>
                         <h4>Usage</h4>
                         <pre class="javascript code"><code>var c = paper.image("apple.png", 10, 10, 100, 100);</code></pre>
+                        <h3 id="text">
+                            text
+                        </h3>
+                        <p>
+                            Draws a text string.
+                        </p>
+                        <h4>Parameters</h4>
+                        <ol>
+                            <li>x <em>number</em> X coordinate position.</li>
+                            <li>y <em>number</em> Y coordinate position.</li>
+                            <li>text <em>string</em> The text string to draw.</li>
+                        </ol>
+                        <h4>Usage</h4>
+                        <pre class="javascript code"><code>var t = paper.text(10, 10, "Look mom, I'm scalable!");</code></pre>
                         <h3 id="path">
                             path
                         </h3>