File: curves_example.html

Recommend this page to a friend!
  Classes of Arturs Sosins   Canvas Turtle   curves_example.html   Download  
File: curves_example.html
Role: Example script
Content type: text/plain
Description: Example drawing curves
Class: Canvas Turtle
Interpret and render graphic commands in a Canvas
Author: By
Last change: Comments changed
Date: 12 years ago
Size: 1,141 bytes


Class file image Download
<!-- /************************************************************* * This script is developed by Arturs Sosins aka ar2rsawseen, * Feel free to distribute and modify code, but keep reference to its creator * * Canvas Turtle provides LOGO Turtle Grpahics Javascript API * and LOGO Turtle Grpahic language interpreter for drawing * objects in Canvas * * For more information, examples and online documentation visit: * **************************************************************/ --> <html> <head> </head> <body> <div id='logo_div'></div> <script src="./canvas_turtle.packed.js" type="text/javascript"></script> <script> var l = new canvas_turtle("logo_div", { //width of canvas width: 800, //height of canvas height: 600, //start value for x axis }); //rectangle with round corners for(var i = 0; i < 4; i++) { l.goleft(100, 100); l.draw(100); } //move away l.point(90); l.move(200); //draw circle for(var i = 0; i < 8; i++) { l.goleft(25, 50); } </script> </body> </html>