Skip to content

Instantly share code, notes, and snippets.

@ei-grad
Last active January 27, 2017 10:53
Show Gist options
  • Save ei-grad/7170b24e93e1f7056f6acb7cdf7f7107 to your computer and use it in GitHub Desktop.
Save ei-grad/7170b24e93e1f7056f6acb7cdf7f7107 to your computer and use it in GitHub Desktop.
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