파이 게임으로 몇 가지 테스트를 해왔지만 표면이 붙어 있습니다. 나는 그 위에 표면이나 무언가를 그릴 수 없다.파이 게임 표면이 보이지 않음
이 작동 :
pygame.draw.circle(screen, (0,0,0), (25,25),25)
하지만이 없습니다 :
pygame.draw.circle(surface, (0,0,0), (25,25),25)
내가 화면에 뭔가를 그릴 할 때
import pygame
pygame.init()
screen = pygame.display.set_mode((400, 300))
#surface = pygame.Surface((100, 100))
done = False
screen.fill((255, 255, 255))
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
#surface = pygame.Surface((50, 50))
surface = pygame.Surface((100, 100))
#surface.fill((255, 0, 0))
#surface.set_colorkey((255, 0, 0))
pygame.draw.circle(surface, (0,0,0), (25,25),25)
#pygame.draw.rect(screen, (0, 128, 255), pygame.Rect(30, 30, 60, 60))
pygame.display.flip()
그래서 그것을립니다 여기 내 코드입니다
일부 문서를 읽었으나 표면을 호출하고 배경을 지정하는 것으로 충분합니다. 흰색입니다. 왜냐하면 기본적으로 검은 색이 그려지기 때문입니다. 나는 정말로 내가 잘못하고있는 것을하지 않는다.
정보가 충분하기를 바랍니다.
건배.
서페이스를 화면에 블리트해야합니다. –
[다음은 서페이스에 대한 간단한 소개입니다.] (http://stackoverflow.com/documentation/pygame/7079/drawing-on-the-screen/23787/surfaces#t=201704182035216002602) –
감사합니다. 매우 감사합니다. –