本文整理汇总了Python中pandac.PandaModules.WindowProperties.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setTitle方法的具体用法?Python WindowProperties.setTitle怎么用?Python WindowProperties.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
ShowBase.__init__(self)
self.decisions = []
self.isReady = False
self.red = 0
self.messageNode = TextNode("Message")
self.choiceOneNode = TextNode("ChoiceOne")
self.choiceTwoNode = TextNode("ChoiceTwo")
self.instructionsNode = TextNode("Instructions")
self.messageNode.setText('"Antigone, stop screaming!"')
self.choiceOneNode.setText("[stop]")
self.choiceTwoNode.setText("[scream louder]")
self.instructionsNode.setText("Use the arrow keys to make a choice.")
base.setBackgroundColor(self.red, 0, 0)
base.disableMouse()
props = WindowProperties()
props.setTitle("Antigo Me")
base.win.requestProperties(props)
self.textDisplay()
self.showText()
self.isReady = True
self.accept("arrow_left", self.decision, [0])
self.accept("arrow_right", self.decision, [1])
示例2: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
ShowBase.__init__(self)
self.disableMouse()
props = WindowProperties()
props.setTitle('Test')
self.win.requestProperties(props)
# self.render.setAntiAlias(AntialiasAttrib.MAuto)
self.transitions = Transitions(self.loader)
self.transitions.setFadeColor(0, 0, 0)
self.filters = CommonFilters(self.win, self.cam)
# self.filters.setCartoonInk()
self.filters.setBlurSharpen(1)
# self.filters.setVolumetricLighting(self.render)
# self.buffer = self.win.makeTextureBuffer("Post-processing buffer", self.win.getXSize(), self.win.getXSize())
# print self.buffer.getYSize()
# self.texture = self.buffer.getTexture()
# self.buffer.setSort(-100)
#
# self.originalCamera = self.camera
# self.offScreenCamera = self.makeCamera(self.buffer)
# self.camera = self.offScreenCamera
#
# self.img = OnscreenImage(image=self.texture, pos=(0, 0, 0.5))
self.scene = None
self.channel = Channel()
示例3: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
""" Initialisiert die Kamera, die Runtime und den Eventhandler. Ladet die Planeten und startet das Programm
"""
props = WindowProperties()
props.setTitle('Solarsystem')
base.win.requestProperties(props)
base.setBackgroundColor(0, 0, 0)
# The global variables we used to control the speed and size of objects
self.yearscale = 60
self.dayscale = self.yearscale / 365.0 * 5
self.orbitscale = 10
self.sizescale = 0.6
self.skySize = 80
self.runtime = RuntimeHandler()
self.camera = Camera(render, self.skySize)
self.loadLuminaries()
self.runtime.rotateLuminaries()
self.eventHandler = EventHandler(self.runtime, self.camera, self.runtime.getLuminary('sun'))
示例4: set_defaults
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def set_defaults(self):
"""Sets some environment defaults that might be overridden by the modules."""
font = loader.loadFont('arial.ttf',textureMargin=5)
font.setPixelsPerUnit(128)
base.win.setClearColorActive(True)
base.win.setClearColor((0.3, 0.3, 0.3, 1))
winprops = WindowProperties()
winprops.setTitle('SNAP')
base.win.requestProperties(winprops)
示例5: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
ShowBase.__init__(self) # initializes Panda window from ShowBase
# change window name from "panda" to app name
properties = WindowProperties()
properties.setTitle("Shinsai-Simulator")
base.win.requestProperties(properties)
# adds algorithm to render closer objects first
binManager = CullBinManager.getGlobalPtr()
binManager.addBin("ftb", CullBinManager.BTFrontToBack, 1)
# base.setFrameRateMeter(True)
self.tName = None # name of terrain
self.magnitude = None # magnitude of earthquake
self.titleScreen()
示例6: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
print("began")
self.taskMgr = taskMgr
with open('config.json') as data_file:
self.conf = json.load(data_file)
self.ServerConnection = ServerConnection()#uncomment when going live
self.ServerConnection.connect(self.conf['host'],self.conf['port'])#uncomment when going live
props = WindowProperties( )
props.setTitle( 'Log In' )
props.setFixedSize(True)
props.setSize(1280,740)
props.setOrigin(-2,-2)
base.win.requestProperties( props )
self.base = ShowBase
self.main_theme = base.loader.loadSfx("assets/sounds/terminator_theme.ogg")
self.main_theme.play()
self.username = ""
self.authConnection = AuthConnectionModel(self)#uncomment when going live
self.heartbeatConnection = HeartbeatConnectionModel()#uncomment when going live
self.ServerConnection.setupConnectionModel(self.heartbeatConnection)#uncomment when going live
self.globalChatConnection = ChatConnectionModel(self)
self.ServerConnection.setupConnectionModel(self.globalChatConnection)
self.queueConnection = QueueConnectionModel(self)
self.ServerConnection.setupConnectionModel(self.authConnection)#uncomment when going live
self.friendConnection = FriendConnectionModel(self)
self.ServerConnection.setupConnectionModel(self.friendConnection)
self.taskMgr.doMethodLater(self.conf['heartbeatRate'], self.doHeartbeat, "heartbeat")#uncomment when going live
self.taskMgr.doMethodLater(self.conf['heartbeatRate'], self.doHeartbeat, "heartbeat")
self.screen = Login(self)#uncomment when going live
#self.screen = Menu(self)#comment this one when you are trying to log into it like normal
self.ServerConnection.setupConnectionModel(self.queueConnection)
self.taskMgr.doMethodLater(self.conf['heartbeatRate'], self.doHeartbeat, "heartbeat")
self.taskMgr.doMethodLater(1, self.doSong, "song")
self.screenType = "login"
self.screen.run()
示例7: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self, World):
#just comment out the two lines below
#self.appRunner = None#added this to overide the login
self.playerList = []
self.World = World
self.WhichScreen = "";
self.lastSelectedFriend = None
# variable to save game selected DD or RR
self.selectedGame = None
#self.taskMgr = World.taskMgr#added this to overide the login
props = WindowProperties()
props.setTitle( 'Main Menu' )
props.setFixedSize(True)
props.setSize(1400,740)
props.setOrigin(-2,-2)
base.win.requestProperties( props )
self.selectedCar = 0
self.screenBtns = []
self.globalChat = []
self.privateChat = {}
self.chatOffset = 0
self.car = None
self.onReturnMatch = self.createMatchMaking
self.createSocialization()
self.World.queueConnection.setHandler(self.handleQueueNotification)
self.World.globalChatConnection.setHandler(self.handleChatNotification)
self.World.friendConnection.setHandlers(self.handleFriendNotification,self.handleFriendListNotification)
#self.World.privateChatConnection.setHandler(self.handlePrivateChatNotification)
self.navi()
self.accept('enter', self.sendMessage)
示例8: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self, scene_file, pedestrian_file, dir, mode):
ShowBase.__init__(self)
self.globalClock = ClockObject.getGlobalClock()
self.globalClock.setMode(ClockObject.MSlave)
self.directory = dir
self.model = Model(dir)
self.loadScene(scene_file)
self.loadPedestrians(pedestrian_file)
self.cam_label = OST("Top Down", pos=(0, 0.95), fg=(1,1,1,1),
scale=0.05, mayChange=True)
self.time_label = OST("Time: 0.0", pos=(-1.3, 0.95), fg=(1,1,1,1),
scale=0.06, mayChange=True, align=TextNode.ALeft)
self.accept("arrow_right", self.changeCamera, [1])
self.accept("arrow_left", self.changeCamera, [-1])
self.accept("escape", self.exit)
self.accept("aspectRatioChanged", self.setAspectRatio)
self.accept("window-event", self.windowChanged)
#base.disableMouse()
lens = OrthographicLens()
lens.setFilmSize(1550, 1000)
self.display_region = base.win.makeDisplayRegion()
self.default_camera = render.attachNewNode(Camera("top down"))
self.default_camera.node().setLens(lens)
self.default_camera.setPosHpr(Vec3( -75, 0, 2200), Vec3(0, -90, 0))
self.setCamera(0)
self.controller = Controller(self, mode)
self.taskMgr.add(self.updateCameraModules, "Update Camera Modules", 80)
self.globalClock.setFrameTime(0.0)
self.width = WIDTH
self.height = HEIGHT
props = WindowProperties( )
props.setTitle( 'Virtual Vision Simulator' )
base.win.requestProperties( props )
示例9: configWorld
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def configWorld(self):
"""Set general settings.
Probably run only once."""
# Set window title
props = WindowProperties()
props.setTitle("Equilibra7d")
self.win.requestProperties(props)
# Enable per-pixel lighting
self.render.setShaderAuto()
# Enable FPS meter
self.setFrameRateMeter(True)
# Fix frame rate
FPS = 60
globalClock = ClockObject.getGlobalClock()
globalClock.setMode(ClockObject.MLimited)
globalClock.setFrameRate(FPS)
示例10: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
ShowBase.__init__(self)
self.title = "Monkeys"
self.setFrameRateMeter(True)
# Disable the camera trackball controls.
self.disableMouse()
props = WindowProperties()
props.setCursorHidden(True)
props.setTitle("Stay Away From The Monkeys")
props.setMouseMode(WindowProperties.M_relative)
self.win.requestProperties(props)
# set scene
self.scene = self.loader.loadModel("models/skyTest.egg")
self.scene.reparentTo(self.render)
m = 37
self.scene.setScale(m, m, m)
self.scene.setPos(0, 0, -5)
# set camera
self.camera.setPos(0, 0, 1)
self.camera.setHpr(0, 0, 0)
self.cameraSpeed = (0, 0, 0)
self.maxSpeed = 0.09
self.lastKeyPressed = ""
self.blockList = []
self.mobMax = 0
self.player = Player(self.camera)
self.loadModel()
self.createBars()
self.die = False
self.paused = True
self.helpScreen()
self.accept("p",self.flipPause)
self.accept("h",self.helpFlip)
self.accept("escape",sys.exit)
self.taskMgr.add(self.update, "updateAll")
示例11: setWindowTitle
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def setWindowTitle(title):
wp = WindowProperties()
wp.setTitle(title)
base.win.requestProperties(wp)
示例12: World
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
class World(DirectObject):
def __init__(self):
self.last_mousex = 0
self.last_mousey = 0
self.zone = None
self.zone_reload_name = None
self.winprops = WindowProperties()
# simple console output
self.consoleNode = NodePath(PandaNode("console_root"))
self.consoleNode.reparentTo(aspect2d)
self.console_num_lines = 24
self.console_cur_line = -1
self.console_lines = []
for i in range(0, self.console_num_lines):
self.console_lines.append(
OnscreenText(
text="",
style=1,
fg=(1, 1, 1, 1),
pos=(-1.3, 0.4 - i * 0.05),
align=TextNode.ALeft,
scale=0.035,
parent=self.consoleNode,
)
)
# Configuration
self.consoleOut("zonewalk v.%s loading configuration" % VERSION)
self.configurator = Configurator(self)
cfg = self.configurator.config
resaveRes = False
if "xres" in cfg:
self.xres = int(cfg["xres"])
else:
self.xres = 1024
resaveRes = True
if "yres" in cfg:
self.yres = int(cfg["yres"])
else:
self.yres = 768
resaveRes = True
if resaveRes:
self.saveDefaultRes()
self.xres_half = self.xres / 2
self.yres_half = self.yres / 2
self.mouse_accum = MouseAccume(lambda: (self.xres_half, self.yres_half))
self.eyeHeight = 7.0
self.rSpeed = 80
self.flyMode = 1
# application window setup
base.win.setClearColor(Vec4(0, 0, 0, 1))
self.winprops.setTitle("zonewalk")
self.winprops.setSize(self.xres, self.yres)
base.win.requestProperties(self.winprops)
base.disableMouse()
# network test stuff
self.login_client = None
if "testnet" in cfg:
if cfg["testnet"] == "1":
self.doLogin()
# Post the instructions
self.title = addTitle("zonewalk v." + VERSION)
self.inst0 = addInstructions(0.95, "[FLYMODE][1]")
self.inst1 = addInstructions(-0.95, "Camera control with WSAD/mouselook. Press K for hotkey list, ESC to exit.")
self.inst2 = addInstructions(0.9, "Loc:")
self.inst3 = addInstructions(0.85, "Hdg:")
self.error_inst = addInstructions(0, "")
self.kh = []
self.campos = Point3(155.6, 41.2, 4.93)
base.camera.setPos(self.campos)
# Accept the application control keys: currently just esc to exit navgen
self.accept("escape", self.exitGame)
self.accept("window-event", self.resizeGame)
# Create some lighting
ambient_level = 0.6
ambientLight = AmbientLight("ambientLight")
ambientLight.setColor(Vec4(ambient_level, ambient_level, ambient_level, 1.0))
render.setLight(render.attachNewNode(ambientLight))
direct_level = 0.8
directionalLight = DirectionalLight("directionalLight")
directionalLight.setDirection(Vec3(0.0, 0.0, -1.0))
directionalLight.setColor(Vec4(direct_level, direct_level, direct_level, 1))
directionalLight.setSpecularColor(Vec4(direct_level, direct_level, direct_level, 1))
render.setLight(render.attachNewNode(directionalLight))
#.........这里部分代码省略.........
示例13: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def __init__(self):
""" Initializes the Simulator object """
props = WindowProperties( )
props.setTitle( 'IsisWorld v0.3' )
base.win.requestProperties( props )
# initialize GUI components
self.title = OnscreenText(text="IsisWorld",
style=1, fg=(0,1,1,1), font = self.font,
pos=(0.85,0.95,1), scale = .07)
self.escapeEventText = self.genLabelText("ESC: quit", 0)
self.instuctText_3 = self.genLabelText("a,s: Rotate world camera", 1)
self.pauseEventText = self.genLabelText("p: (un)pause; SPACE advances simulator one time step.",2)
self.instuctText_1 = self.genLabelText("up,down,left,right: to control Ralph's direction", 3)
self.instuctText_2 = self.genLabelText("h,j,k,l: to control Ralph's head orientation", 4)
self.objectText = self.genLabelText("o: display objects in Ralph's visual field", 5)
self.teacher_utterances = [] # last message typed
# main dialogue box
def disable_keys(x):
# print "disabling"
x.command_box.enterText("")
x.command_box.suppressKeys=True
x.command_box["frameColor"]=(0.631, 0.219, 0.247,1)
def enable_keys(x):
# print "enabling"
x.command_box["frameColor"]=(0.631, 0.219, 0.247,.25)
x.command_box.suppressKeys=False
def accept_message(message,x):
x.teacher_utterances.append(message)
x.command_box.enterText("")
#text_fg=((.094,0.137,0.0039,1),
self.command_box = DirectEntry(pos=(-1.2,-0.95,-0.95), text_fg=(0.282, 0.725, 0.850,1), frameColor=(0.631, 0.219, 0.247,0.25), suppressKeys=1, initialText="enter text and hit return", enableEdit=0,scale=0.07, focus=0, focusInCommand=disable_keys, focusOutCommand=enable_keys, focusInExtraArgs=[self], focusOutExtraArgs=[self], command=accept_message, extraArgs=[self], entryFont=self.font, width=15, numLines=1)
#base.win.setColor(0.5,0.8,0.8)
base.win.setClearColor(Vec4(0,0,0,1))
self.initialize_simulator_relax_thread_task()
# setup terrain
self.env = loader.loadModel("models/world/world")
self.env.reparentTo(render)
self.env.setPos(0,0,0)
self.env.setCollideMask(BitMask32.bit(1))
self.env.setColor(0.5,0.8,0.8)
render.showBounds()
#self.goal_sleep = Bar(100,1)
#self.goal_sleep.reparentTo(render)
dlight = DirectionalLight('dlight')
dlight.setColor(VBase4(0.6, 0.6, 0.6, 1))
dlnp = render.attachNewNode(dlight)
dlnp.setHpr(-60, -60, 0)
render.setLight(dlnp)
alight = AmbientLight('alight')
alight.setColor(VBase4(1.0, 1.0, 1.0, 1))
alnp = render.attachNewNode(alight)
render.setLight(alnp)
self.agent = Character(self, "models/ralph/ralph", {"walk":"models/ralph/ralph-walk", "run": "models/ralph/ralph-run"}, VBase3(6, 2, 0), .2)
self.agent.control__say("Hi, I'm Ralph. Please build me.")
### Set up displays and cameras ###
self.camera = FloatingCamera(self.agent.actor)
# set up picture in picture
dr = base.camNode.getDisplayRegion(0)
aspect_ratio = 16.0 / 9.0
window = dr.getWindow()
pip_size = 0.40 # percentage of width of screen
dr_pip = window.makeDisplayRegion(1-pip_size,1,0,(1.0 / aspect_ratio) * float(dr.getPixelWidth())/float(dr.getPixelHeight()) * pip_size)
dr_pip.setCamera(self.agent.fov)
dr_pip.setSort(dr.getSort())
dr_pip.setClearColor(VBase4(0, 0, 0, 1))
dr_pip.setClearColorActive(True)
dr_pip.setClearDepthActive(True)
#self.agent.fov.node().getLens().setAspectRatio(aspect_ratio)
dr_pip.setActive(1)
## SET UP I/O ##
base.disableMouse()
# Accept some keys to move the camera.
self.accept("a-up", self.camera.setControl, ["right", 0])
self.accept("a", self.camera.setControl, ["right", 1])
self.accept("s-up", self.camera.setControl, ["left", 0])
self.accept("s", self.camera.setControl, ["left", 1])
# control keys to move the character
self.accept("arrow_left", self.agent.control__turn_left__start, [])
self.accept("arrow_left-up", self.agent.control__turn_left__stop, [])
self.accept("arrow_right", self.agent.control__turn_right__start, [])
self.accept("arrow_right-up", self.agent.control__turn_right__stop, [])
self.accept("arrow_up", self.agent.control__move_forward__start, [])
self.accept("arrow_up-up", self.agent.control__move_forward__stop, [])
self.accept("arrow_down", self.agent.control__move_backward__start, [])
#.........这里部分代码省略.........
示例14: setWindowName
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
def setWindowName(self, name):
props = WindowProperties()
props.setTitle(name)
base.win.requestProperties(props)
示例15: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setTitle [as 别名]
#.........这里部分代码省略.........
X_ = self.p3d.camera.getX()
Y_ = self.p3d.camera.getY()
C = 0.5*self.dt
if self.mouse_pos[0] < self.width * -0.47 :
X_ -= self.p3d.camera.getZ()*C
self.minimap.update_pos()
if self.mouse_pos[0] > self.width * 0.47 :
X_ += self.p3d.camera.getZ()*C
self.minimap.update_pos()
if self.mouse_pos[1] < self.height * -0.47 :
Y_ -= self.p3d.camera.getZ()*C
self.minimap.update_pos()
if self.mouse_pos[1] > self.height * 0.47 :
Y_ += self.p3d.camera.getZ()*C
self.minimap.update_pos()
self.p3d.camera.setX( X_ )
self.p3d.camera.setY( Y_ )
def mouse_click_left(self):
self.game_pipe.send(('mouse_click_left',))
def mouse_click_right(self):
self.game_pipe.send(('mouse_click_right',))
def frame(self):
self.p3d.taskMgr.step()
self.dt = globalClock.getDt()
if globalClock.getRealTime() - self.title_last_update_time > self.title_update_time :
self.props = WindowProperties(self.p3d.win.getProperties())
self.title_last_update_time = globalClock.getRealTime()
self.fps = globalClock.getAverageFrameRate()
title = str(self.fps) + str(self.mouse_pos[:]) + str(self.mouse_on_map_pos[:])
self.props.setTitle(title)
self.p3d.win.requestProperties(self.props)
def draw_line(self, **kwargs):
ps = kwargs.get('points',[])
name = ''
if 'name' in kwargs.keys() :
name = kwargs['name']
if self.check_name(name) :
#print 'draw_line name duplicated', name
return None
else :
name = self.generate_name()
ls = LineSegs()
if 'width' in kwargs.keys() : ls.setThickness( kwargs['width'] )
if 'color' in kwargs.keys() : ls.setColor( (kwargs['color'][0], kwargs['color'][1], kwargs['color'][2], kwargs['color'][3]) )
for i in ps :
ls.drawTo(i[0], i[1], i[2])
node = ls.create()
np = NodePath(node)
if 'parent' in kwargs.keys() and kwargs['parent'] <> None :
self.get_parent(kwargs['parent']).attachNewNode(np.node())
else :
render.attachNewNode(np.node())
self.elements[ name ] = np
return name, np