[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] help: problem with pygame.display.get_surface
- To: pygame-users@xxxxxxxx
- Subject: [pygame] help: problem with pygame.display.get_surface
- From: inhahe <inhahe@xxxxxxxxx>
- Date: Fri, 12 Oct 2007 06:11:57 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 12 Oct 2007 06:12:06 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=Nx2JlCiUdcVXkpoGHfhp40ByZt+iFYOtLWsa7tnOHko=; b=I1MPC4TCyo0L0KTubXjrb7W76zzIBWVzLw8HWcZ9GXeePW6IYaQUjOziWpFIVi1Oev1NxLOTJz/Ac3Sqe4OTLYl7y7WhKqndFKOXNRFn4Hm8iEISdocylZ/5S8MLd9DHPV44GosYm7knqyi9GjumCpxyefflrogNYvMI006Dx7w=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=AfIlQNw+rZS5Oh+PNVRcqrDyY9lFqikaJEmiUuQaumUCkdySgjCxr+Rqu3WGb4Rc2SEdaG7rmfKpJ1MClzqcq1aj72jVhQ63GL+cQd/rV1FStCBVcbNmxDIPYNxJmJoTA2WXlYo1GqHhezyH5zHuWV0JlNyCJojJ9+y69SXzwe0=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I'm having a problem here. I want to get a new surface when I resize
a window so that I have access to the entire window, if it's bigger.
So I figured screen = pygame.display.get_surface() is the way. But
it's not working. it's giving me a surface with the same dimensions
as the display before it's resized. Here's some minimal code that
shows the problem:
import pygame
screen = pygame.display.set_mode((800,600), pygame.RESIZABLE)
while 1:
event = pygame.event.wait()
if event.type == pygame.VIDEORESIZE:
print event
print pygame.display.get_surface()
the printout of event shows the new dimensions of the display, and
pygame.display.get_surface() is returning a surface with the old
dimensions.
OS: Windows XP SP2
Python: 2.5.1
pygame: 1.7.1release
Is this a bug, or am I doing it wrong, and is there any other way to do this?