Last active
January 27, 2017 10:53
-
-
Save ei-grad/7170b24e93e1f7056f6acb7cdf7f7107 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pygame | |
| def show(a): | |
| global screen | |
| if 'screen' not in globals(): | |
| screen = pygame.display.set_mode((0, 0), pygame.RESIZABLE) | |
| for event in pygame.event.get(): | |
| if event.type == pygame.VIDEORESIZE: | |
| screen = pygame.display.set_mode(event.dict['size'], pygame.RESIZABLE) | |
| pygame.transform.scale(pygame.surfarray.make_surface( | |
| np.swapaxes(a, 0, 1), | |
| ), screen.get_size(), screen) | |
| pygame.display.flip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment