0

I would like to know if there is a way to add or upload an image in python without closing the game.

For example, there is a menu and it has an option "Add your image" and it would change the image of the game

Thanks.

  • 1
    Yes, there is. Without any details at all about how your game works, how it's displaying the image, etc., it's really hard to say any more than that. – abarnert Jul 10 '18 at 22:52
  • Well i have a project for the university, and im doing an "Endless Runner" so... what i want to do is to change the block, obstacles, the runner and the background with the images i would like to put but obviously, with a determined size of the picture uploaded – Alvaro Nuñez Mendoza Jul 10 '18 at 23:02
  • 1
    That still isn't nearly enough for anyone to answer your question beyond "Yes, it's possible." (In fact, I'm even more confused. What do you mean by "upload" here? Is there a game server, and the client downloads images from the server, so you need to upload the image to the server?) – abarnert Jul 10 '18 at 23:10
  • I think you want a file browser - for a player to select an image from within the game? If thats the case then there are a few code examples for keeping everything in pygame, or you could use something like tkinter. Though its not clear what you want from your question. – F. Elliot Jul 10 '18 at 23:13
  • @F.Elliot YES! that is what i wanted, sorry if i confused you all, but i dont know where to find some examples of that – Alvaro Nuñez Mendoza Jul 10 '18 at 23:21
  • 1
    Your question is dangerously close to 'someone give me the answer to my homework' rather than 'im stuck'. I would be tempted to use something like [this](https://stackoverflow.com/questions/18326350/lightweight-cross-platform-way-to-prompt-for-a-file). Some approaches I'd suggest: 1) Use google/stack for examples, 2) let the user select from several images pre-loaded 3) let user select from several images loaded into a folder. good luck - dont be surprised if this thread gets locked :) – F. Elliot Jul 11 '18 at 00:00

0 Answers0