{"id":7373,"date":"2020-09-16T11:56:15","date_gmt":"2020-09-16T09:56:15","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=7373"},"modified":"2020-09-16T11:56:15","modified_gmt":"2020-09-16T09:56:15","slug":"make-a-full-screen-window-with-pygame","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/make-a-full-screen-window-with-pygame\/","title":{"rendered":"Make a full screen window with pygame"},"content":{"rendered":"<p>This code will make a full screen window with pygame that you can close with Esc key. At the end you will see the width and height of the screen.<\/p>\n<pre class=\"lang:default decode:true \"># phisyc.py\r\nimport pygame\r\nimport sys\r\n\r\n\r\npygame.init()\r\nWSIZE = (0, 0)\r\nscreen = pygame.display.set_mode(WSIZE)\r\nW, H = screen.get_size()\r\nprint(W, H)\r\nclock = pygame.time.Clock()\r\n\r\nloop = 1\r\nwhile loop:\r\n    for event in pygame.event.get():\r\n        if event.type == pygame.QUIT:\r\n            loop = 0\r\n        if event.type == pygame.KEYDOWN:\r\n            if event.key == pygame.K_ESCAPE:\r\n                loop = 0\r\n\r\n    pygame.display.update()\r\n    clock.tick(60)\r\n\r\n\r\n\r\npygame.quit()\r\nsys.exit()<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"Full screen with pygame\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/make-a-full-screen-window-with-pygame\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[191],"tags":[909,194],"class_list":["post-7373","post","type-post","status-publish","format-standard","hentry","category-pygame","tag-full-screen","tag-pygame"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":true,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/7373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=7373"}],"version-history":[{"count":1,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/7373\/revisions"}],"predecessor-version":[{"id":7374,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/7373\/revisions\/7374"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=7373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=7373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=7373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}