[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Re: pygame.error: Cannot set 0 sized display mode



Al Sweigart <al@...> writes:

> 
> 
> hey Pete,It might be a change for with a different version of Pygame.
> I never thought that passing (0, 0) for the resolution would work. I
> suppose before it was using a default resolution for you. (Though 
>the fullscreen mode stretches the display sometimes, if you give it
> a small resolution. I'm not sure about the specific details though.)
> I'd go ahead and just pass (1280, 1024), since I think it is idea 
>to pass an actual resolution.Alternatively, after executing import
> pygame and pygame.init(), you can check the value in
> pygame.display.Info().current_w and 
>pygame.display.Info().current_h for the current screen resolution,
> and then pass these values to set_display(). Then 
>the program will run at the current resolution no matter what
> computer it is run on.-Al

According to the documentation, and the earlier behavior of the script
passing (0,0) should indeed set the size of the display to the full
screen resolution. If I hard-coded in (1280,1024) I successfully set
the screen size.  However, later in the script I was using an object
created by pygame.display.info - it complained when I tried to use
current_w that that property did not exist.  So I
don't think your plan would work.