Move origin from center to top left corner in Python turtle?

Question:

I want the top left corner to be the reference point (0,0) and the origin represented by other coordinates (x>0, y>0).

Asked By: user8193156

||

Answers:

You can change coordinates using turtle.setworldcoordinates(llx, lly, urx, ury)

Documentation:
https://docs.python.org/3.0/library/turtle.html#turtle.setworldcoordinates

Answered By: custom_user

didn’t solve my real problem. i inserted a RawTurtle into a tkinter
Canvas. but i could not find the RawTurtle.setworldcoordinates method
as i find it in turtle.setworldcoordinates

import tkinter as tk
import turtle

root = tk.Tk()

canvas = turtle.ScrolledCanvas(root)
canvas.pack(side=tk.LEFT)

screen = turtle.TurtleScreen(canvas)
screen.setworldcoordinates(-10, 100, 100, -10)

turtle = turtle.RawTurtle(screen)
turtle.goto(90, 90)

screen.mainloop()

You wrap the Tk canvas in a TurtleScreen and create your RawTurtle on that wrapped canvas. Then you can use setworldcoordinates() to manipulate the coordinate system.

Answered By: cdlane