How do I make my 2d game fit screen size in arcade library

802 views Asked by At

actually I'm trying to code my first 2d game with python, using arcade library. I want to know if there's a way to make the game fit any screen size without manual adjustment of the width and height:

import arcade

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
1

There are 1 answers

2
Alderven On

Option 1. Use full screen mode

Launch you arcade app with fullscreen=True flag:

window = arcade.Window(fullscreen=True)

Detailed example here.

Option 2. Get display size

Use get_display_size function to get screen resolution:

width, height = arcade.window_commands.get_display_size()