“Adicionar imagem à janela do pygame” Respostas de código

Carregue imagens pygame

import pygame
from pygame.locals import*
img = pygame.image.load('clouds.bmp')

white = (255, 64, 64)
w = 640
h = 480
screen = pygame.display.set_mode((w, h))
screen.fill((white))
running = 1

while running:
    screen.fill((white))
    screen.blit(img,(0,0))
    pygame.display.flip()
TheProgrammer

Adicionar imagem à janela do pygame

import pygame, sys
from pygame.locals import *

pygame.init()
window = pygame.display.set_mode((600,400))
pygame.display.set_caption('Test')

img = pygame.image.load('yourimg.png') # if your image is in a folder type 'folder/yourimg.png'
imgX, imgY = 50, 50

while True:
  window.fill((0,0,0))

  for event in pygame.event.get():
    if event.type == QUIT:
      pygame.quit()
      sys.exit()
  
  window.blit(img, (imgX,imgY))
  pygame.display.update()
The DevKid

Respostas semelhantes a “Adicionar imagem à janela do pygame”

Perguntas semelhantes a “Adicionar imagem à janela do pygame”

Mais respostas relacionadas para “Adicionar imagem à janela do pygame” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código