Changeset 1d1c77e in python-game for game.py


Ignore:
Timestamp:
Mar 6, 2017, 2:47:30 AM (8 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
master
Children:
e79c833
Parents:
b632a7c
Message:

Correctly detect the native resolution on Mac

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game.py

    rb632a7c r1d1c77e  
    1919   w = root.winfo_screenwidth()
    2020   h = root.winfo_screenheight()
     21elif system == 'Darwin':
     22   print("Mac detected")
     23
     24   from AppKit import NSScreen
     25   res = NSScreen.mainScreen().frame().size
     26   w = int(res.width)
     27   h = int(res.height)
    2128else:
    2229   print("Unknown OS: " + system)
Note: See TracChangeset for help on using the changeset viewer.