当前位置: 首页>>代码示例>>Python>>正文


Python WindowProperties.setTitle方法代码示例

本文整理汇总了Python中panda3d.core.WindowProperties.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setTitle方法的具体用法?Python WindowProperties.setTitle怎么用?Python WindowProperties.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在panda3d.core.WindowProperties的用法示例。


在下文中一共展示了WindowProperties.setTitle方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
 def __init__(self):
     ShowBase.__init__(self)
     Globals.OFFLINE = False
     self.client = 0
     self.engine = 0
     
     #PStatClient.connect()
     
     wp = WindowProperties()
     wp.setSize(Settings.WIDTH, Settings.HEIGHT)
     wp.setTitle("Modifire")
     wp.setMouseMode(WindowProperties.MRelative)
     #wp.setCursorHidden(True) 
     base.win.requestProperties(wp)
     base.setBackgroundColor(0.133, 0.133, 0.133) 
     self.disableMouse()
     self.client = Client()
     self.mainMenu = MainMenu()
     self.SetupEventHandlers()
     self.pid = -1
     self.loadingScreen = None
     
     SettingsController.LoadClientSettings()
     
     version = OnscreenText(text = Globals.VERSION, pos = (0.3, -0.07), scale = 0.07, fg = (1, 1, 1, 1))
     version.reparentTo(base.a2dTopLeft)
     version.setBin('fixed', 200)
     
     Preloader.Preload()
开发者ID:czorn,项目名称:Modifire,代码行数:31,代码来源:main.py

示例2: setupWindow

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
 def setupWindow(self):
     wp = WindowProperties()
     wp.setFullscreen(settings.FULLSCREEN)
     wp.setSize(settings.WIDTH, settings.HEIGHT)
     wp.setTitle("GAME")
     base.win.requestProperties(wp)
     base.win.setClearColor(Vec4(0.5, 0.5, 0.8, 1))
开发者ID:genusgant,项目名称:Panda3d-TowerDefense_Game,代码行数:9,代码来源:main.py

示例3: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
 def __init__(self):
     ShowBase.__init__(self)
     
     wp = WindowProperties()
     wp.setSize(850, 480)
     wp.setTitle("GAME")
     base.win.requestProperties(wp)
     
     bgg = BlockGeometryGenerator()
     
     blocks = []
     
     for x in xrange(1):
         for y in xrange(512):
             for z in xrange(64):
                 bid = random.randint(0, 255)
                 blocks.append(bid)
                 bgg.GenerateBlockGeometry(x, y, z, Block(bid), [0])
                 #blocks[x * 512 * 64 + y * 64 + z] = 1
         print x
         
     ambientLight = AmbientLight('ambientLight')
     ambientLight.setColor(Vec4(0.2, 0.2, 0.2, 1))
     ambientLightNP = render.attachNewNode(ambientLight)
     render.setLight(ambientLightNP)
开发者ID:czorn,项目名称:Modifire,代码行数:27,代码来源:TestLargeChunk.py

示例4: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
 def __init__(self):
     ShowBase.__init__(self)
     
     wp = WindowProperties()
     wp.setSize(850, 480)
     wp.setTitle("GAME")
     base.win.requestProperties(wp)
     
     c = Client()
开发者ID:czorn,项目名称:Modifire,代码行数:11,代码来源:TestTCP.py

示例5: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
 def __init__(self):
     ShowBase.__init__(self)
     
     wp = WindowProperties()
     wp.setSize(850, 480)
     wp.setTitle("GAME")
     base.win.requestProperties(wp)
     
     c = DeathNotifications()
     
     self.accept('a', c.AddMessage, extraArgs=['Player1', 'mp5', 'Tedasdasd'])
开发者ID:czorn,项目名称:Modifire,代码行数:13,代码来源:TestChat.py

示例6: main

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
def main():
	props = WindowProperties( )

	props.setTitle( 'El Juego Loco' )
	props.setCursorFilename(Filename.binaryFilename("cursor.ico"))
	props.setFullscreen(0)
	props.setSize(1024, 768)

	game = World()

	game.win.setClearColor((0, 0, 0, 1))
	game.win.requestProperties( props )
	game.setFrameRateMeter(True)

	game.run()
开发者ID:JauriaStudios,项目名称:pandasandbox,代码行数:17,代码来源:main.py

示例7: setup_camera_text

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
    def setup_camera_text(self):
        try:
            self.title.removeNode()
        except:
            pass

        # This creates the on screen title that is in every tutorial
        cam = self.cameras[self.currentCamera]
        camera_text = " ("+cam['name']+")"
        self.title = OnscreenText(text=self.device_title + camera_text,
                                  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 )
开发者ID:felipesanches,项目名称:MAME_3D_models,代码行数:18,代码来源:main.py

示例8: main

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
def main():

    props = WindowProperties( )

    props.setTitle('Hostil Galaxy')
    props.setCursorFilename(Filename.binaryFilename('cursor.ico'))
    props.setCursorHidden(False)
    props.setFullscreen(False)
    props.setSize(800, 600)

    game = World()

    game.win.setClearColor((0, 0, 0, 1))
    game.win.requestProperties(props)
    game.setFrameRateMeter(True)

    game.run()
开发者ID:TheCheapestPixels,项目名称:HostilGalaxy,代码行数:19,代码来源:main.py

示例9: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
 def __init__(self):
     ShowBase.__init__(self)
     version = OnscreenText(text = Globals.VERSION, pos = (0.3, -0.07), scale = 0.07, fg = (1, 1, 1, 1))
     version.reparentTo(base.a2dTopLeft)
     Globals.OFFLINE = False
     
     #PStatClient.connect()
     
     wp = WindowProperties()
     wp.setSize(850, 480)
     wp.setTitle("SERVER")
     base.win.requestProperties(wp)
     base.win.setClearColor(Vec4(0.133, 0.133, 0.133, 1)) 
     #self.disableMouse()
     
     SettingsController.LoadServerSettings()
     
     self.options = ServerOptionsMenu()
     self.accept('escape', self.Exit)
     self.accept(ServerStartEvent.EventName, self.Start)
开发者ID:czorn,项目名称:Modifire,代码行数:22,代码来源:mainServer.py

示例10: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
    def __init__(self, width, height, isFullscreen, title):
        
        ShowBase.__init__(self)

        #=======================================================================
        # Set window properties.
        #=======================================================================
        win_props = WindowProperties(self.win.getProperties())
        win_props.setTitle(title)
        win_props.setFullscreen(isFullscreen)
        win_props.setSize(width, height)
        self.win.requestProperties(win_props)
        
        # Apply the property changes.
        self.graphicsEngine.openWindows()

        #=======================================================================
        # Scene related fields.
        #=======================================================================
        self.sceneNP = None
        '''
        Main scene node path. There can be only one scene at any given time.
        '''

        #=======================================================================
        # Actor related fields.
        #=======================================================================
        self.actorNP = {}
        '''
        Dictionary of actor node paths keyed with the actor name.Internal use 
        only.
        '''
        
        self.actorOINP = None
        '''
        Actor of interest node path. There can be only one actor of interest
        at any given time.
        '''

        self.actorOIName = None
        '''
        Actor of interest name. There can be only one actor of interest at any 
        given time.
        '''

        self.actorOIMoveDir = 0
        '''
        Actor of interest movement direction indicator. Forward is 1, reverse is
        -1, and stop is 0.
        '''

        self.actorOITurnDir = 0
        '''
        Actor of interest turn direction indicator. Left is 1, right is -1, and 
        no turn is 0.
        '''

        self.actorOIMoveSpeed = 3
        '''
        Actor of interest translational speed. Distance units per second.
        '''
        
        self.actorOITurnSpeed = 30
        '''
        Actor of interest rotational speed. Degrees per second.
        '''
        
        self.actorOILocation = Vec3D.zero()
        '''
        Actor of interest's location coordinates after the last frame.
        '''
        
        self.actorOIVelocity = Vec3D.zero()
        '''
        Actor of interest's velocity vector after the last frame.
        '''

        #=======================================================================
        # Camera related fields.
        #=======================================================================
        self.cameraNP = {}
        '''
        Dictionary of camera node paths keyed with the camera name.
        '''

        # Add the showbase camera as 'default'.
        self.cameraNP['default'] = self.cam

        #=======================================================================
        # Illumination related fields
        #=======================================================================
        self.lightNP  = {}
        '''
        Dictionary of light node paths keyed with the light name.
        '''

        self.goalNP  = {}
        '''
        Dictionary of goal node paths keyed with the goal name.
        '''
#.........这里部分代码省略.........
开发者ID:alexbw,项目名称:Simworld,代码行数:103,代码来源:simworldbase.py

示例11: WindowProperties

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
import sys
import Globals
import time
import os
import tempfile
import LocalizerEnglish as Localizer
from panda3d.core import WindowProperties

print 'Gathering Data...'
#time.sleep(0.1)
print 'Loading Toontown...'
print 'DirectStart: Starting Make A Toon.'
base.disableMouse()
wp = WindowProperties()
tempdir = tempfile.mkdtemp()
wp.setTitle('Toontown Emulator')
wp.setCursorFilename('toonmono.cur')
wp.setIconFilename('icon.ico')
base.win.requestProperties( wp )
base.setAspectRatio(1.3333333334)
base.camera.hide()
base.camera.setPos(-0.30, -11, 3)
base.camera.setHpr(-3, 0, 0)
class MakeAToon:
    def __init__(self):
        self.notify = DirectNotifyGlobal.directNotify.newCategory("Starting Make A Toon.")
        self.localAvatar = LocalAvatar.toonBody
        base.localAvatar = self.localAvatar
        self.toonColors = Localizer.toonColorDict
        self.colorNum = 0
        self.numColors = Localizer.numColors
开发者ID:DauntlessTT,项目名称:Emulator-Project,代码行数:33,代码来源:MakeAToon.py

示例12: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]
    def __init__(self):
        "初始化"
                
        dir = os.path.dirname(game_settings['save_folder'])
        if not os.path.exists(dir):
            os.makedirs(dir)
        
        self.initGameSettings()
        
        #读取设置文件
        loadPrcFile("config/PandaConfig.prc")
        
        loadPrcFileData('', 'win-size ' + str(game_settings['screen_resolution'][0]) + ' ' + str(game_settings['screen_resolution'][1]) )
        
        #构造Panda3D的ShowBase
        ShowBase.__init__(self)
        
        #Retrieving available resolutions
        #self.makeDefaultPipe()
        di = self.pipe.getDisplayInformation()
        self.supportedResolutions = []
        for index in range(di.getTotalDisplayModes()):
            self.supportedResolutions.append((di.getDisplayModeWidth(index), di.getDisplayModeHeight(index)))
        
        
        color_themes.initStyles()
        
        props = WindowProperties( self.win.getProperties() )
        props.setSize(int(game_settings['screen_resolution'][0]),int(game_settings['screen_resolution'][1]))
        if game_settings['full_screen'] and not props.getFullscreen():
            props.setFullscreen(True)
        props.setTitle(game_settings['window_title'])
        self.win.requestProperties(props)
        
        self.cam2dp.node().getDisplayRegion(0).setSort(-20)  #Set render2dp to background
        self.disableMouse() #Disable panda3d's default mouse control
        self.cam.node().getDisplayRegion(0).setActive(0) #disable default camera
        self.audioPlayer = AudioPlayer()
        self.focusStack = [] #a stack that shows windowstop window gets focus
        
        self._loadReadText()
        self._loadGlobalData()

            
        #add event handlers
        self.accept('alt-enter', self.toggleFullScreen)
        self.accept('save_data', self.save)
        self.accept('load_data', self.load)
        self.accept('load_memory', self.loadMemory)
        self.accept('request_focus', self.grantFocus)
        self.accept('remove_focus', self.cancelFocus)
        self.accept('return_to_title', self.returnToTitle)
        self.accept('start_game', self.startGame)
        self.accept('load_game', self.loadGame)
        self.accept('config_form', self.showConfig)
        self.accept('exit_game', self.exit)
        self.accept('quick_save', self.quickSave)
        self.accept('quick_load', self.quickLoad)
        self.accept('auto_save', self.autoSave)
        self.accept('print_screen', self.takeScrnShot)
        self.accept('f10', self.takeScrnShot)
        
        #Font setting
        self.textFont = color_themes.default_font
        
        #背景设置
        self.setBackgroundColor(0,0,0,1); 
        self.backgroundImage = None
            
        self.initGameWindows()
        
        self.mainMenu = None
        self.storyManager = None
开发者ID:WindyDarian,项目名称:Sogal,代码行数:75,代码来源:sogal_base.py

示例13: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setTitle [as 别名]

#.........这里部分代码省略.........
        
        # Load PDB structures
        receptor = PDBReader.read_pdb_from_file(pdb_file1)
        ligand = PDBReader.read_pdb_from_file(pdb_file2)
        receptor.move_to_origin()
        ligand.move_to_origin()
        
        # Background
        base.setBackgroundColor(0.7, 0.7, 0.7, 1.0)
        
        # Load Color maps
        color_map_cpk = CPK()
        color_map_bfactor = BFactor(min_value=-14.0, max_value=8.0, middle_value=0.0)
        
        # Load 3D model
        self.receptor_node = render.attachNewNode("Receptor")
        if full_atom:
            self.load_protein_full_atom(receptor, self.receptor_node, color_map_bfactor)
        else:
            self.load_protein_residue(receptor, self.receptor_node)
        self.receptor_node.reparentTo(render)
        
        self.ligand_node = render.attachNewNode("Ligand")
        if full_atom:
            self.load_protein_full_atom(ligand, self.ligand_node, color_map_cpk)
        else:
            self.load_protein_residue(ligand, self.ligand_node)
        self.ligand_node.reparentTo(render)
        
        # Ambient lights
        self.alight = AmbientLight('alight')
        self.alight.setColor(LVecBase4f(0.162679, 0.162679, 0.169059, 1.0))
        self.alnp = render.attachNewNode(self.alight)
        render.setLight(self.alnp)
        
        # Center receptor and ligand
        self.center_proteins()
        
        # Center camera on complexes
        self.center = loader.loadModel("models/atom_sphere")
        self.center.setColor(0.0, 0.53, 0.0, 1.0)
        self.center_camera()
        
        # DirectionalLight
        self.dlight = DirectionalLight('dlight')
        self.dlight.setColor(LVecBase4f(0.797448, 0.660287, 0.743222, 1.0))
        self.dlight.setShadowCaster(True, 512, 512)
        render.setShaderAuto()
        self.dlnp = render.attachNewNode(self.dlight)
        self.dlnp.setPos(0,-50,0)
        render.setLight(self.dlnp)
        self.dlnp.lookAt(self.center)
        l1 = loader.loadModel("models/Dirlight")
        l1.setColor(1.0, 1.0, 0.0, 1.0)
        l1.setPos(0, -50, 0)
        l1.setScale(1)
        self.lights = [l1]
        
        # Post processing        
        render.setAntialias(AntialiasAttrib.MAuto)
        
        # Show control structures if required
        if self.structures:
            for light in self.lights:
                light.reparentTo(render)
            self.center.reparentTo(render)
            
        # Movement functions
        taskMgr.add(self.ligand_movement, 'ligand_movement') 

        # Key mapping
        self.key_bindings()
        
        # Show frame rate
        if debug:
            base.setFrameRateMeter(True)
    
        # Create two windows from cameras pointing to each molecule
        wx = base.win.getProperties().getXOrigin()
        wy = base.win.getProperties().getYOrigin() 
        
        # Ligand window
        wp = WindowProperties()
        wp.setSize(300,300)
        wp.setOrigin(self.width + wx + 10, wy - 50)
        wp.setTitle('From Ligand')
        self.ligand_view = base.openWindow(props=wp)
        self.cam_ligand = base.camList[1]
        self.cam_ligand.setPos(self.center.getX(), self.center.getY(), self.center.getZ())
        self.cam_ligand.lookAt(self.receptor_node)
        
        # Receptor window
        wp = WindowProperties()
        wp.setSize(300,300)
        wp.setOrigin(self.width + wx + 10, wy + 300)
        wp.setTitle('From Receptor')
        self.receptor_view = base.openWindow(props=wp)
        self.cam_receptor = base.camList[2]
        self.cam_receptor.setPos(self.center.getX(), self.center.getY(), self.center.getZ())
        self.cam_receptor.lookAt(self.ligand_node)
开发者ID:brianjimenez,项目名称:dockit,代码行数:104,代码来源:dockit.py


注:本文中的panda3d.core.WindowProperties.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。