turtle.setheading()

turtle.setheading(to_angle) turtle.seth(to_angle) Parameters: to_angle – a number (integer or float) Set the orientation of the turtle to to_angle. Here are some common directions in degrees: standard mode logo mode 0 - east 0 - north 90 - north 90 - east 180 - west 180 - south 270 - south 270 - west >>> turtle.setheading(90) >>> turtle.heading() 90.0

turtle.settiltangle()

turtle.settiltangle(angle) Parameters: angle – a number Rotate the turtleshape to point in the direction specified by angle, regardless of its current tilt-angle. Do not change the turtle’s heading (direction of movement). >>> turtle.reset() >>> turtle.shape("circle") >>> turtle.shapesize(5,2) >>> turtle.settiltangle(45) >>> turtle.fd(50) >>> turtle.settiltangle(-45) >>> turtle.fd(50) Deprecated since version 3.1.

turtle.setpos()

turtle.setpos(x, y=None) turtle.setposition(x, y=None) Parameters: x – a number or a pair/vector of numbers y – a number or None If y is None, x must be a pair of coordinates or a Vec2D (e.g. as returned by pos()). Move turtle to an absolute position. If the pen is down, draw line. Do not change the turtle’s orientation. >>> tp = turtle.pos() >>> tp (0.00,0.00) >>> turtle.setpos(60,30) >>> turtle.pos() (60.00,30.00) >>> turtle.setpos((20,80)

turtle.setposition()

turtle.setposition(x, y=None) Parameters: x – a number or a pair/vector of numbers y – a number or None If y is None, x must be a pair of coordinates or a Vec2D (e.g. as returned by pos()). Move turtle to an absolute position. If the pen is down, draw line. Do not change the turtle’s orientation. >>> tp = turtle.pos() >>> tp (0.00,0.00) >>> turtle.setpos(60,30) >>> turtle.pos() (60.00,30.00) >>> turtle.setpos((20,80)) >>> turtle.po

turtle.Screen

class turtle.Screen Subclass of TurtleScreen, with four methods added.

turtle.seth()

turtle.seth(to_angle) Parameters: to_angle – a number (integer or float) Set the orientation of the turtle to to_angle. Here are some common directions in degrees: standard mode logo mode 0 - east 0 - north 90 - north 90 - east 180 - west 180 - south 270 - south 270 - west >>> turtle.setheading(90) >>> turtle.heading() 90.0

turtle.rt()

turtle.rt(angle) Parameters: angle – a number (integer or float) Turn turtle right by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.) Angle orientation depends on the turtle mode, see mode(). >>> turtle.heading() 22.0 >>> turtle.right(45) >>> turtle.heading() 337.0

turtle.screensize()

turtle.screensize(canvwidth=None, canvheight=None, bg=None) Parameters: canvwidth – positive integer, new width of canvas in pixels canvheight – positive integer, new height of canvas in pixels bg – colorstring or color-tuple, new background color If no arguments are given, return current (canvaswidth, canvasheight). Else resize the canvas the turtles are drawing on. Do not alter the drawing window. To observe hidden parts of the canvas, use the scrollbars. With this method, one can m

turtle.ScrolledCanvas

class turtle.ScrolledCanvas(master) Parameters: master – some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas with scrollbars added Used by class Screen, which thus automatically provides a ScrolledCanvas as playground for the turtles.

turtle.resetscreen()

turtle.resetscreen() Reset all Turtles on the Screen to their initial state. Note This TurtleScreen method is available as a global function only under the name resetscreen. The global function reset is another one derived from the Turtle method reset.