Rescale pixel's size pygame [duplicate]

2019-09-14 00:03发布

This question already has an answer here:

I'm using pygame 1.9. How to make window bigger, than it's size definite by pixel's size. For example, I create display with 100x100 pixel. And fill it by numpy array.

screenarray=np.zeros((100, 100))
screenarray.fill(10)
screen = pygame.display.set_mode((100,100))
surface = pygame.surfarray.make_surface(screenarray)
screen.blit(surface, (0, 0))
pygame.display.flip()

And it's too small, I even can see anything. I want to rescale it by 600x600 pixels of my display. How to rescale "pixel's size"?

1条回答
ら.Afraid
2楼-- · 2019-09-14 00:43

I do not really get what you were trying to explain but maybe newSurface = pygame.transform.scale(surface, (newWidth, newHeight)) is the right thing for you.

查看更多
登录 后发表回答