The Arcade library is a modern Python Module used widely for developing 2D video games with compelling graphics and sound. Arcade is an object-oriented library. It can be installed like any other Python Package.
In this article, we will learn what are the arcade inbuilt functions to draw point.
Arcade library is a modern framework, which makes drawing illustrations very easily through its inbuilt functions. In arcade, we have two inbuilt functions to draw point.
1. arcade.draw_point( ): It is used to draw a point and you can even draw multiple points using this function by calling it as many times you want to.
Syntax: arcade.draw_point(x , y, color , size)
- x – is position of point.
- y -is position of point.
- Color – specify color using arcade.color.COLOR NAME. (Note that color name should in Capital letters.)
- Size – Size of the point in pixels.
Approach For drawing a point using arcade.draw_point:
- Import Arcade module
- Open the window and Set the window parameters.
- Set the background color of the output window.(optional)
- Start the render process
- Implement aracde.draw_point() with its specified parameters.
- Finish rendering
- Keep the window up until you close it.
Program 1: (Program to draw a single point)
Program 2: (Program to draw multiple points)
2. arcade.draw_points ( ): With this function, it is easier to draw multiple points that to in a particular pattern.
Syntax: arcade.draw_points(point_list , color , size)
- point_list – It is basically list of points where each point is in a list. So it is a list of lists.
- Color -specify color using arcade.color.COLOR NAME. (Note that color name should in Capital letters.)
- Size– Size of the point in pixels.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.