Changeset b632a7c in python-game for game.py


Ignore:
Timestamp:
Mar 6, 2017, 1:27:56 AM (8 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
1d1c77e
Parents:
3960923
Message:

Add a README and correctly detect the native resolution on Linux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game.py

    r3960923 rb632a7c  
    1010   import ctypes
    1111   user32 = ctypes.windll.user32
    12    [w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)]
     12   w = user32.GetSystemMetrics(0)
     13   h = user32.GetSystemMetrics(1)
    1314elif system == 'Linux':
    1415   print("Linux detected")
     16
     17   import tkinter
     18   root = tkinter.Tk()
     19   w = root.winfo_screenwidth()
     20   h = root.winfo_screenheight()
    1521else:
    1622   print("Unknown OS: " + system)
Note: See TracChangeset for help on using the changeset viewer.