From 54d9e122ba1f66a217eeaf67c4cb0bca306c4f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Sat, 7 Nov 2015 23:12:52 -0200 Subject: [PATCH] Add "F" key option for toggling fullscreen mode. --- README.md | 8 +++++--- main.py | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f3b34d0..017ab74 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,13 @@ There's also a python script in this repository for converting STL files to EGG # keyboard commands -**TAB** alternates between the default orbiting camera and any other camera that may have been declared in the 3d artwork layout XML file. +**TAB** key alternates between the default orbiting camera and any other camera that may have been declared in the 3d artwork layout XML file. -**ESC** exists +**ESC** key exists the program. -**h** and **g** are used to control the motion relative to the first **motion** tag found in an XML file. For Galaxy Force II Super Deluxe, it controls the rotation of the cabinet. +**H** and **G** keys are used to control the motion relative to the first **motion** tag found in an XML file. For Galaxy Force II Super Deluxe, it controls the rotation of the cabinet. + +**F** key toggles fullscreen mode. # Tips diff --git a/main.py b/main.py index 7fbaf84..b2c9761 100755 --- a/main.py +++ b/main.py @@ -120,6 +120,9 @@ def __init__(self, layout_dir): self.setupCamera(0) self.setup_camera_text() + self.isFullScreen = True + self.toggle_fullscreen() #so that we actually start windowed... + # Add procedures to the task manager. self.taskMgr.add(self.update_camera, "UpdateCameraTask") self.taskMgr.add(self.update_motion, "UpdateMotionTask") @@ -279,6 +282,16 @@ def setup_event_handlers(self): self.accept("p", self.toggleAllLights) self.accept("h", self.manual_rotation, [0.1]) self.accept("g", self.manual_rotation, [-0.1]) + self.accept("f", self.toggle_fullscreen) + + def toggle_fullscreen(self): + wp = WindowProperties() + self.isFullScreen = not self.isFullScreen + wp.setFullscreen(self.isFullScreen) + wp.setSize(1024, 768) + base.openMainWindow() + base.win.requestProperties(wp) + base.graphicsEngine.openWindows() def setup_camera_text(self): try: