python - Tkinter: background image problems -


i'm working on game competition , it's coming along pretty nicely far. made image want use background, loaded , placed same did player image:

self.bg_1=photoimage(file="bg_space.gif")  bg1=self.create_image(0,0,image=self.bg_1) 

this result: bg error

it shows quarter of whole image. file size big? did code wrong?

i tried making 4 images, 1 each quarter of image, , position them in correct spots on canvas. turned out worse, , think showed quarter of well.

i'm pretty puzzled this, , appreciate anyone's input on this. thanks

by default image centered on coordinate give it. change this, set parameter anchor "nw" (northwest):

bg1=self.create_image(0,0,image=self.bg_1, anchor="nw") 

Comments