Feb-18-2021, 06:35 AM
if i add a variable for the image like so this does work, but i still have to manually figure out what positions are the limits and then enter those numbers,
the 680 for x and 326 for y. if my image is 720X400 give or take and the object is 60X60
the 680 for x and 326 for y. if my image is 720X400 give or take and the object is 60X60
def move(self,x,y): imgx,imgy = canvas.coords(self.id) print(imgx,imgy) x = max(-imgx, min(x , 680 -imgx )) y = max(-imgy, min(y, 326 -imgy )) self.x += x self.y += y canvas.move(self.id, x,y)