| OLD | NEW |
| 1 --- | 1 --- |
| 2 layout: default | 2 layout: default |
| 3 title: "Spirodraw Sample" | 3 title: "Spirodraw Sample" |
| 4 --- | 4 --- |
| 5 <h1>Spirodraw code walkthrough</h1> | 5 <h1>Spirodraw code walkthrough</h1> |
| 6 | 6 |
| 7 <aside class="note"> | |
| 8 <p>The <a href="https://code.google.com/p/dart/source/browse/branches/bleeding_e
dge/dart/samples/#samples%2Fspirodraw%253Fstate%253Dclosed">full source code</a>
for this sample is available.</p> | 7 <p>The <a href="https://code.google.com/p/dart/source/browse/branches/bleeding_e
dge/dart/samples/#samples%2Fspirodraw%253Fstate%253Dclosed">full source code</a>
for this sample is available.</p> |
| 8 |
| 9 <p> | 9 <p> |
| 10 You can also <a href="/samples/spirodraw/spirodraw-js.html">run the sample</a>, | |
| 11 which was compiled to JavaScript using <code>htmlconverter.py | |
| 12 --optimize</code>. | |
| 13 </p> | |
| 14 | |
| 15 <p><b>Note:</b> | |
| 16 The sample uses the HTML5 input range element; | 10 The sample uses the HTML5 input range element; |
| 17 it doesn't display properly in browsers that don't support that element. | 11 it doesn't display properly in browsers that don't support that element. |
| 18 </p> | 12 </p> |
| 19 </aside> | |
| 20 | 13 |
| 21 <p>The Spirodraw sample is similar to | 14 <p>The Spirodraw sample is similar to |
| 22 <a href="/samples/sunflower/">Sunflower</a> | 15 <a href="/samples/sunflower/">Sunflower</a> |
| 23 and illustrates a few more language features.</p> | 16 and illustrates a few more language features.</p> |
| 24 | 17 |
| 25 <ul> | 18 <ul> |
| 26 <li><a href="#code_organization">Code organization</a></li> | 19 <li><a href="#code_organization">Code organization</a></li> |
| 27 <li><a href="#requestAnimationFrame">RequestAnimationFrame</a></li> | 20 <li><a href="#requestAnimationFrame">RequestAnimationFrame</a></li> |
| 28 <li><a href="#string_interpolation">String interpolation</a></li> | 21 <li><a href="#string_interpolation">String interpolation</a></li> |
| 29 <li><a href="#top_level_functions">Top-level functions</a></li> | 22 <li><a href="#top_level_functions">Top-level functions</a></li> |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 automatically invoke the getter or setter when you reference a variable having t
he same | 275 automatically invoke the getter or setter when you reference a variable having t
he same |
| 283 name as the getter/setter. By convention, the actual variable name is prefixed w
ith an | 276 name as the getter/setter. By convention, the actual variable name is prefixed w
ith an |
| 284 underscore, which makes it private to the library and distinguishes it from the | 277 underscore, which makes it private to the library and distinguishes it from the |
| 285 getter/setter name.</p> | 278 getter/setter name.</p> |
| 286 | 279 |
| 287 <h2 id="for-in">For-in statement</h2> | 280 <h2 id="for-in">For-in statement</h2> |
| 288 <p>Our last bit of syntactic sugar is shown in lines 89-90. The for-in loop iter
ates over | 281 <p>Our last bit of syntactic sugar is shown in lines 89-90. The for-in loop iter
ates over |
| 289 any object that implements the Iterable interface.</p> | 282 any object that implements the Iterable interface.</p> |
| 290 | 283 |
| 291 | 284 |
| OLD | NEW |