Skip to content

Commit

Permalink
set window title with program name, device title and camera description
Browse files Browse the repository at this point in the history
  • Loading branch information
felipesanches committed Nov 7, 2015
1 parent ccf3cba commit f9cedb8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions main.py
Expand Up @@ -14,6 +14,7 @@
from panda3d.core import PointLight
from panda3d.core import Material
from panda3d.core import LVector3, LVecBase4f, VBase4, LPoint3f
from panda3d.core import WindowProperties
from direct.showbase.ShowBase import ShowBase
from direct.gui.OnscreenText import OnscreenText
from direct.task import Task
Expand Down Expand Up @@ -117,7 +118,7 @@ def __init__(self, layout_dir):

self.currentCamera = 0
self.setupCamera(0)
self.setup_text_overlay()
self.setup_camera_text()

# Add procedures to the task manager.
self.taskMgr.add(self.update_camera, "UpdateCameraTask")
Expand Down Expand Up @@ -269,7 +270,7 @@ def parseModelElements(self, currentNode, elements):

def selectNextCamera(self):
self.currentCamera = (self.currentCamera + 1) % len(self.cameras)
self.setup_text_overlay()
self.setup_camera_text()

def setup_event_handlers(self):
# listen to keys for controlling the lights
Expand All @@ -279,7 +280,7 @@ def setup_event_handlers(self):
self.accept("h", self.manual_rotation, [0.1])
self.accept("g", self.manual_rotation, [-0.1])

def setup_text_overlay(self):
def setup_camera_text(self):
try:
self.title.removeNode()
except:
Expand All @@ -292,6 +293,11 @@ def setup_text_overlay(self):
style=1, fg=(1, 1, 0, 1), shadow=(0, 0, 0, 0.5),
pos=(0.0, -0.95), scale = .07)

props = WindowProperties()
props.setTitle( "[MAME 3D artwork system prototype] " + self.device_title + camera_text )
base.win.requestProperties( props )


def setup_scene(self):
self.load_3D_Model(filename = "../common/egg/disco_hall", color=(0.5, 0.6, 0.5, 1), position=(0, 80, -10), hpr=(90, 0, 0), scale=1)

Expand Down

0 comments on commit f9cedb8

Please sign in to comment.