Login   Register  
Icontem

File: text_example.html

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Arturs Sosins  >  Canvas Turtle  >  text_example.html  >  Download  
File: text_example.html
Role: Example script
Content type: text/plain
Description: Example drawing text
Class: Canvas Turtle
Interpret and render graphic commands in a Canvas
Author: By
Last change: Comments changed
Date: 2011-09-11 12:08
Size: 1,056 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,
	//start value for x axis
});
l.font("20px Arial");
for(var i = 0; i < 4; i++)
{
	l.draw(50);
	l.turtleprint("Hello world");
	l.draw(50);
	l.right(90);
}
</script>
</body>
</html>