Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having problems with the screen size #7

Open
CnX0401 opened this issue Jan 14, 2023 · 1 comment
Open

Having problems with the screen size #7

CnX0401 opened this issue Jan 14, 2023 · 1 comment

Comments

@CnX0401
Copy link

CnX0401 commented Jan 14, 2023

Can anyone please share the code where the game runs in full screen
1920 x 1080

@eeshawn11
Copy link

eeshawn11 commented Mar 14, 2023

Option 1:
If you specifically want it to run at 1920 x 1080, you can specify the SCREEN_WIDTH and SCREEN_HEIGHT variables and pass in an additional pygame.FULLSCREEN flag when creating the screen. You'll probably have to scale the background images accordingly as well.

SCREEN_WIDTH = 1920
SCREEN_HEIGHT = 1080

screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT), flags=pygame.FULLSCREEN)

Option 2:
The other option would be to scale accordingly to the 16:9 aspect ratio based on the existing game design:

SCREEN_WIDTH = 800
SCREEN_HEIGHT = SCREEN_WIDTH // 16 * 9

screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT), flags=pygame.FULLSCREEN | pygame.SCALED)

You can probably give it a try and see which suits your needs best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants