0

I'm working on a game for a competition and it's coming along pretty nicely so far. I made an image I want to use as a background, so I loaded and placed it the same as I did with the player image:

self.bg_1=PhotoImage(file="bg_space.gif")

bg1=self.create_image(0,0,image=self.bg_1)

This is the result: bg error

It only shows a quarter of the whole image. Is the file size too big? Did I code something wrong?

I tried making four images, one for each quarter of the image, and position them in the correct spots on the canvas. This turned out even worse, and I think only showed a quarter of those as well.

I'm pretty puzzled about this, and would appreciate anyone's input on this. thanks

2

1 Answer 1

1

By default the image is centered on the coordinate you give it. To change this, set the parameter anchor to "nw" (northwest):

bg1=self.create_image(0,0,image=self.bg_1, anchor="nw")
1
  • Thanks a lot Bryan, you saved the day again! Commented May 22, 2013 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.