Pygame Screen Size to Large

937 Views Asked by At

I have a problem with my pygame display. I am making it the same size as my screens dimension, so when I fullscreen it there will be no black borders around the edges. I am using current_w and current_h before generating a pygame display to do this. But when I run the game the display is to big and I can't see it all in fullscreen. It is not a problem with the fullscreen though, if I turn fullscreen off the window is too large and can't fit onto my screen. I have printed out the results of current_w and current_h, getting 1920 and 1080, which are the right numbers, my computer screen resolution being those numbers. The problem doesn't seem to be with the fullscreen or the resolution, so I have no idea what is wrong.

So to sum my problem up:

  • I want a pygame display with the same size as my screen resolution
  • The display is to large, unable to fit onto my screen
  • Despite this, the display's dimensions match up with those of my screen resolution

Any help will be greatly appreciated, thanks

The code I am using to get my screen size and create the display are:

infoObject = pygame.display.Info()
display = pygame.display.set_mode((infoObject.current_w, infoObject.current_h))

I have tried fullscreen, as I mentioned previously, like this:

display = pygame.display.set_mode((infoObject.current_w,inforObject.current_h),pygame.FULLSCREEN)
0

There are 0 best solutions below