Hi!
I use pandac, because i need this for set a window title.
or exsist a better way?
here my code:
import sys
import os, re
path = os.environ['PATH'].split(';')
def is_problem(folder):
try:
for item in os.listdir(folder):
if re.match(r'msvcr\d\d\.dll', item):
return True
except:
pass
return False
path = [folder for folder in path if not is_problem(folder)]
os.environ['PATH'] = ';'.join(path)
from panda3d.core import ConfigPageManager
from pandac.PandaModules import loadPrcFileData
loadPrcFileData('','show-dll-error-dialog 1')
ConfigPageManager.getGlobalPtr().reloadImplicitPages()
from pandac.PandaModules import WindowProperties
props = WindowProperties( )
from panda3d.core import *
props.setTitle( 'The last Act, pre Alpha' )
from direct.showbase.DirectObject import DirectObject
from direct.showbase.ShowBase import ShowBase
import menus as menu
from speech import speak as spk
import sound as so
s = so.sound("bass.dll")
spk("wird Geladen, bitte Warten...")
print "Wird geladen..."
s.load_sounds("sounds.dat","abc")
#s.musicdict["sounds/music/Loading.ogg"].Play()
#print s.musicdict["sounds/music/Loading.ogg"].SetAttribute(2,0.2)
#raw_input("enter...")
class tla(ShowBase):
def __init__(self):
# Initialize the ShowBase class from which we inherit, which will
# create a window and set up everything we need for rendering into it.
ShowBase.__init__(self)
self.accept("escape", sys.exit) # Escape quits
# setup the gameloop
self.gameTask = taskMgr.add(self.gameLoop, "gameLoop")
def gameLoop(self, task):
mm=mainmenu.run()
if mm == "spiel beenden":
sys.exit()
return task.done
if mm == "spiel starten":
spk("Tut mir leid, dass ist noch nicht eingebaut.")
return task.cont
base = tla()
print "pfad ", base.mainDir
base.win.requestProperties( props )
mainmenu = menu.Menu(title="Hauptmenue", options=["spiel starten", "spiel beenden"], sounds={"change":s.sounddict["sounds/menu/menu_item.ogg"],"select":s.sounddict["sounds/menu/menu_selected.ogg"],"music":s.sounddict["sounds/menu/music 4.ogg"]})
base.run()
In the moment i can compile my gameā¦ but when i start the p3d file, it pop up a c runtime error r4036
maybe, since I use pandac?