GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python/pygame-tips/creating the screen at python · Yosef91/python

Expand file tree

/

creating the screen

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
17 lines (14 loc) · 992 Bytes
/

creating the screen

Copy path

File metadata and controls

17 lines (14 loc) · 992 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
to create the screen, you need three lines of code.
The first two are very important!
The first line is just importing pygame.
The second line is just to initialize pygame, to do this just write pygame.init()
The third line of code is making a variable equal to pygame.display.set_mode(())
Inside those the perantacies inside the perantacies, write how big you want your screen to be for exemple if I wrote:
pygame.display.set_mode((500,300))
then my screen would be 500 by 300 pixels big!
This next line of code is optional, if you want to give your screen a name, then write:
pygame.display.set_caption("whatever you want it to be named")
this will pop up on the top of the screen. If you don't do it, then it will be called pygame window.
This line of code is also optional, if you want to change the picture on the top left corner of the screen from a frog to something else, just
write:
pygame.display.set_icon("the path to the picture you want at the top left corner of the screen")
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.