Skip to content

Commit

Permalink
Add "F" key option for toggling fullscreen mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
felipesanches committed Nov 8, 2015
1 parent f9cedb8 commit 54d9e12
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions main.py
Expand Up @@ -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")
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 54d9e12

Please sign in to comment.