List of available commands: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 21: Line 21:
* t.lookTo([x,y]) (Turtle looks to a coordinate pair. If t2 is another turtle object: t.lookTo(t2.pos))
* t.lookTo([x,y]) (Turtle looks to a coordinate pair. If t2 is another turtle object: t.lookTo(t2.pos))
</source>
</source>
<jsxgraph height="300" width="600" filename="wuerfel_drehbar_dreieck.gxt" />


[[Category:Turtle Graphics]]
[[Category:Turtle Graphics]]

Revision as of 13:56, 18 February 2009

There is a predefined turtle object t. Therefore, all commands start with t, like t.fd(100);

* t.forward(len); or t.fd(len);
* t.back(len); or t.bk(len);
* t.right(angle); or t.rt(angle); (<math>0\leq angle \leq 360</math>)
* t.left(angle); or t.lt(angle);
* t.penUp(); or t.pu();
* t.penDown(); or t.pd();
* t.clearScreen(); or t.cs();
* t.clean();
* t.setPos(x,y); 
* t.home();
* t.hideTurtle(); or t.ht();
* t.showTurtle(); or t.st();
* t.setPenSize(size); (size: number)
* t.setPenColor(col); (col: colorString, e.g. 'red' or '#ff0000')
* t.setProperty({key1:value1,key2:value2,...});
* t.pushTurtle()
* t.popTurtle()
* t.lookTo([x,y]) (Turtle looks to a coordinate pair. If t2 is another turtle object: t.lookTo(t2.pos))