File: simple_example.html

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

Contents

Class file image Download
<!-- /************************************************************* * This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com * 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: * http://webcodingeasy.com/JS-classes/Canvas-Turtle-graphics-using-javascript **************************************************************/ --> <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, //on error callback if canvas is unsupported on_error: null, //graphic for turtle (for debugging) turtle: "./turtle.png" }); for(var i = 0; i < 4; i++) { l.draw(100); l.right(90); } </script> </body> </html>