- def change_surface(self, surface
+ def change_surface(self, surface):
- Set the screen to be attached to a new surface
(with new resolution)
+ Set the screen to be attached to a new surface
After calling this method, all new draws will go to `surface`.
Do not call this method in the middle of a draw operation.
- size = surface.get_size()
- # first check is in case we're changing to the same surface, in which
- # case we maybe can't _see_ that the size has changed, but it has.
- if old is surface or old.get_size() != size:
- self.clear() # FIXME: why doesn't this clear the edges?
elif evt.type == pygame.MOUSEMOTION:
elif evt.type == pygame.VIDEORESIZE:
- self.change_surface(self.surface, evt.size)
+ # FIXME: only update the border squares to be black
+ pygame.display.set_mode(evt.size, pygame.RESIZABLE))
def _handle_keyup(self, k):