非常に単純なpyGameで割り当てを行っています。ウィンドウに画像をロードする必要がありますが、ロードされません! そして、IDLEにはエラーが表示されません..画像への相対パス(room.png)と絶対パス(C:... \ room.png)を試しましたが、何もしませんでした。これが私のコードです。
import pygame, sys #import pygame and system library
from pygame import * #import all pygame sublibs
pygame.init()
screen = display.set_mode((385,384)) #set screen size
display.set_caption("Blit example")
#this one gets the current working directory
background_file_name = "room.png" #import bg
background_surface = pygame.image.load(background_file_name) #use bg
while True:
for e in pygame.event.get():
if e.type==QUIT: #break the loop and quit
pygame.quit()
sys.exit()
break
screen.fill((255,0,255)) #fill the screen with magenta
screen.blit(background_surface, (0,0))
display.update()