[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] help: problem with pygame.display.get_surface
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] help: problem with pygame.display.get_surface
- From: "Brian Fisher" <brian@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 12 Oct 2007 08:41:52 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 12 Oct 2007 11:42:00 -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:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=z/cKmTelyZd1WwMm1rm2p8AFZ57tlytrDSNAbjKIkpw=; b=YFhqn3JMDwh12Hi/lf+e4/H0uzvMmK41INq9K0x9uA2lvftg2yucOGT/1nx2PlzAwKqJChan8Gn65tQY7sk/ubjjM7T3wemHo1c8f40dKElwdLdh0P20PdC61IEnIvWxPHM3yTTLUPpCxvJXPUDpo799PTp2C7nFpZFD7K0dK8E=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=GmzB+IHcZvqVz7c6BfdXsJCfRghMxQcu6hCGt1p+Y7iLMf6PzD78ajjtk/ZHqyNWEczwFmd3H5ogLZN/Dk15DSCQzx29Z1UGiiJYdNcDOiU3OxNbd3rGZSTax57VQSpw5Sj0pZnjx3vEZLo1urEe4kQhE81ZlPE85FvAdc97N60=
- In-reply-to: <da776a8c0710120311t5160c6dfx8c21f386161e8927@xxxxxxxxxxxxxx>
- References: <da776a8c0710120311t5160c6dfx8c21f386161e8927@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
do you get what you want if you change the display resolution to match
the window? (see below)
----
import pygame
screen = pygame.display.set_mode((800,600), pygame.RESIZABLE)
while 1:
event = pygame.event.wait()
if event.type == pygame.VIDEORESIZE:
print event
screen = pygame.display.set_mode(event.size, pygame.RESIZABLE)
print pygame.display.get_surface()
if event.type == pygame.QUIT:
break
On 10/12/07, inhahe <inhahe@xxxxxxxxx> wrote:
> 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?
>