Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Draw a circle using Arcade in Python3
Next article icon

Establishing an Arcade window in Python

Last Updated : 22 Oct, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

The arcade library is a high-tech Python Package with an advanced set of tools for making 2D games with gripping graphics and sound. It is Object-oriented and is specially built for Python 3.6 and above versions.

There are five mandatory functions needed to do arcade programming.

1. arcade.open_window(): In arcade, everything will be done in the window itself, with the help of open_window(). At present, arcade only supports a single display window but, you can resize it according to your requirement.

This command opens a window with a given size i.e width and height along with screen title. It takes three arguments and the position of each argument is fixed. It is a built-in function in arcade. Syntax is as follows:

Syntax: arcade.open_window(Screen_width, Screen_Height, “Screen_title” , resizable, antialiasing)

Parameters:

  • Screen_width:– Width of the window.
  • Screen_Height:- Height of the window.
  • Screen_title:– Title of the window.
  • resizable:– Whether the window can  be user resizable or not.
  • antialiasing:- It tells whether graphics are smooth or not.

Implementation of the above syntax:

Python3

# importing the module
import arcade
 
arcade.open_window(500, 500, "Welcome to GFG " , False,  False)
                      
                       

Output:

2. arcade.set_background_color(): Arcade makes it really easy to set the background color, let’s start how to set the background color. In the arcade module, we have an inbuilt function arcade.set_background_color( ) function, that is used to set the background colour. Its syntax is as follows:

Syntax: arcade.set_background_color(color)

Parameter:

  • color: specifies the color of the background

Implementation of the above syntax:

To generate a blue background we will run the following command:

arcade.set_background_color(arcade.color.BLUE)

3. arcade.start_render(): It is an inbuilt function in the arcade module of Python which actually informs the arcade module to start functioning. To tell Arcade that you start sending drawing commands, you need to use the arcade.start.render(). It takes no argument. The syntax is as follows:-

Syntax: arcade.start_render()

Parameters: None

4. arcade.finish_render(): It is an inbuilt function in the arcade module of Python which actually displays what we have drawn. It takes no argument. The syntax is as follows:-

Syntax: arcade.finish_render()

Parameters: None

5. arcade.run(): It basically runs the main program. It is usually the last command of the program. It also helps to hold the output on the screen until the user doesn’t exist. The syntax is as follows:

Syntax: arcade.run()

Parameters: None

Since now we have understood the functions and their use. So let’s take an example of implementing all the above mentioned functions together.

Python3

# import arcade module
import arcade
 
# open the window
arcade.open_window(500, 500, "Welcome to GFG", False, False)
 
# set background colour
arcade.set_background_color(arcade.color.PINK)
 
# start drawing
arcade.start_render()
 
# finish drawing
arcade.finish_render()
 
# to keep output
# window open
arcade.run()
                      
                       

Output:



Next Article
Draw a circle using Arcade in Python3

A

anshitaagarwal
Improve
Article Tags :
  • Python
  • Python-Arcade
Practice Tags :
  • python

Similar Reads

  • Draw an arc using Arcade in Python
    The arcade library is a high-tech Python Package with an advanced set of tools for making 2D games with gripping graphics and sound. It is Object-oriented and is specially built for Python 3.6 and above versions. Arcade has two inbuilt functions for drawing arc: 1: arcade.draw_arc_outline ( ): This
    2 min read
  • Draw an ellipse using Arcade library in Python
    Prerequisite: Arcade Library The Arcade library is a modern Python Module used for developing 2D video games with enthralling graphics and sound. It is an object-oriented library. It can be installed like any other Python Package in your IDE. Arcade Module has two inbuilt functions for drawing an el
    3 min read
  • Python - Create window button in GTK+ 3
    GTK+ 3 is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License. Along with Qt, it is one of the most popular toolkits for the Wayland and X11 windowing systems. Let’s see how to cre
    2 min read
  • Python Arcade - Adding Bullets in Game
    In this article, we will learn how to add bullets to a game in Arcade using Python. Adding Bullet In this example, we are going to add bullets to the screen.  For this, we will use some functions: draw_text(): This function is used to draw text to the screen using Pyglet’s label. Syntax: arcade.draw
    4 min read
  • Draw a circle using Arcade in Python3
    The arcade library is a high-tech Python Package with advanced set of tools for making 2D games with gripping graphics and sound. It is Object-oriented and is especially built for Python 3.6 and above versions. Arcade inbuilt functions to draw circle :- 1. arcade.draw_circle_outline( ) : This functi
    3 min read
  • Creating a radar sweep animation using arcade in Python
    The Radar Sweep are used for displays of single level sweeps of radar data, and their display appears in the Main Display window. With the help of arcade module of Python, it is possible to perform a radar sweep animation. Before starting, it is highly recommended to revise concepts of arcade librar
    3 min read
  • Python Arcade - Collision Detection
    In this article, we will learn How we can add collisions in arcade games in Python. Installation You can install the Arcade module using the below command: pip install arcadeExample 1: In this example, we are going to use the check_for_collision() function to add collision between 2 sprites. Syntax:
    4 min read
  • Python Arcade - Adding Levels
    In this article, we will learn how to add different levels to our arcade games in Python. Adding Levels We can easily add multiple levels to our Arcade game by following the below steps: Create a new variable to store the current level.self.level = 1Load the sprites you are going to use in the curre
    4 min read
  • Hangman Game with a GUI in Python
    In this article, we'll be building the Hangman Game. To create the game's graphical user interface (GUI), we'll be using the Pygame library in Python. Pygame is a library commonly used for making graphical user interface games. So, let's dive into creating our Hangman Game with the help of Pygame! W
    8 min read
  • Python Arcade - Adding Enemies
    In this article, we will learn How we can add enemies in arcade. Adding Enemies To add enemy to our game we are going to follow the below steps: First, we will create a variable to store the enemy sprite. Syntax: self.enemy = NoneAfter that, we will create one more variable to store the velocity of
    9 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences