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


Python WindowProperties.getDefault方法代码示例

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


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

示例1: setupWindow

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getDefault [as 别名]
    def setupWindow(self, windowType, x, y, width, height,
                    parent):
        """ Applies the indicated window parameters to the prc
        settings, for future windows; or applies them directly to the
        main window if the window has already been opened.  This is
        called by the browser. """

        if self.started and base.win:
            # If we've already got a window, this must be a
            # resize/reposition request.
            wp = WindowProperties()
            if x or y or windowType == 'embedded':
                wp.setOrigin(x, y)
            if width or height:
                wp.setSize(width, height)
            if windowType == 'embedded':
                wp.setParentWindow(parent)
            wp.setFullscreen(False)
            base.win.requestProperties(wp)
            self.windowProperties = wp
            return

        # If we haven't got a window already, start 'er up.  Apply the
        # requested setting to the prc file, and to the default
        # WindowProperties structure.

        self.__clearWindowProperties()

        if windowType == 'hidden':
            data = 'window-type none\n'
        else:
            data = 'window-type onscreen\n'

        wp = WindowProperties.getDefault()

        wp.clearParentWindow()
        wp.clearOrigin()
        wp.clearSize()

        wp.setFullscreen(False)
        if windowType == 'fullscreen':
            wp.setFullscreen(True)

        if windowType == 'embedded':
            wp.setParentWindow(parent)

        if x or y or windowType == 'embedded':
            wp.setOrigin(x, y)

        if width or height:
            wp.setSize(width, height)

        self.windowProperties = wp
        self.windowPrc = loadPrcFileData("setupWindow", data)
        WindowProperties.setDefault(wp)

        self.gotWindow = True

        # Send this call to the main thread; don't call it directly.
        messenger.send('AppRunner_startIfReady', taskChain = 'default')
开发者ID:Just-D,项目名称:panda3d,代码行数:62,代码来源:AppRunner.py

示例2: init_wp

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getDefault [as 别名]
    def init_wp(window_type, size):
        """Initial / default WindowProperties.

        Args:
            window_type (str): Window type.
            size (Iterable, 2): Width, height.

        Return:
            (WindowProperties): WindowProperties object.

        """
        if window_type == "onscreen":
            wp = WindowProperties.getDefault()
            wp.setSize(size[0], size[1])
        elif window_type == "offscreen":
            wp = WindowProperties.size(size[0], size[1])
        return wp
开发者ID:jhamrick,项目名称:scenesim,代码行数:19,代码来源:lightbase.py

示例3: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getDefault [as 别名]
    def __init__(self):
        
        if DEBUG:
            from pandac.PandaModules import ConfigPageManager
            print ConfigPageManager.getGlobalPtr()

        #Set application properties
        wp = WindowProperties.getDefault()
        wp.setTitle(APPNAME)
        wp.setSize(APPX, APPY)
        WindowProperties.setDefault(wp)

        ShowBase.__init__(self)
        
        self.initScene()
        #InitialSettings
        #~ self.scene.simul_time = datetime(2024,12,31, 8, 44)#sun rise
        #~ self.scene.simul_time = datetime(9999,12,31, 8, 44)
        self.Camera.hm.look(self.sun)
        self.Camera.hm.follow(self.home)
开发者ID:webplate,项目名称:astrini,代码行数:22,代码来源:main.py

示例4: get_aspect_ratio

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getDefault [as 别名]
    def get_aspect_ratio(output):
        """Returns aspect ratio of `output`'s window, or default aspect
        ratio if it has no window.

        Args:
            output (GraphicsOutput): Graphics output.

        Return:
            (float): Aspect ratio.

        """
        aspect_ratio = 1
        if output.hasSize():
            aspect_ratio = (float(output.getSbsLeftXSize()) /
                            float(output.getSbsLeftYSize()))
        else:
            wp = output.getRequestedProperties()
            if not wp.hasSize():
                wp = WindowProperties.getDefault()
            aspect_ratio = float(wp.getXSize()) / float(wp.getYSize())
        return aspect_ratio
开发者ID:jhamrick,项目名称:scenesim,代码行数:23,代码来源:lightbase.py

示例5: loadPrcFileData

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getDefault [as 别名]
from panda3d.core import loadPrcFileData
loadPrcFileData('','textures-power-2 None')#needed for fxaa
loadPrcFileData('','win-size 1024 768')

from direct.showbase.AppRunnerGlobal import appRunner
from panda3d.core import Filename
if appRunner: 
    path=appRunner.p3dFilename.getDirname()+'/'
else: 
    path=""

from panda3d.core import WindowProperties
wp = WindowProperties.getDefault() 
#wp.setFixedSize(True)  #needed for fxaa
wp.setOrigin(-2,-2)  
wp.setTitle("Simple Level Editor for Panda3D")  
WindowProperties.setDefault(wp)

from panda3d.core import *
import direct.directbase.DirectStart
from direct.showbase.DirectObject import DirectObject
from direct.filter.FilterManager import FilterManager
from camcon import CameraControler
from buffpaint import BufferPainter
from guihelper import GuiHelper
import os, sys
from random import uniform 

BUFFER_HEIGHT=0
BUFFER_ATR=1
BUFFER_COLOR=2
开发者ID:michaeladams,项目名称:koparka,代码行数:33,代码来源:main.py

示例6: __init__

# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getDefault [as 别名]
    def __init__(self):
        self.keyMap = {"left":0, "right":0, "forward":0, "back":0, "cam-left":0, "cam-right":0}
        self.flag1=0
        self.flag2=0
        self.flag3=0 
        self.flag4=0
        self.count=0
        self.health = 100
        self.points = -5
        self.flagd=1
        self.player_points = 0
        base.win.setClearColor(Vec4(0,0,0,1))
        
        self.mySound=base.loader.loadSfx("sounds/trial.mp3")
        self.mySound.play()
        
        self.title = addTitle("Bumping Cars")
       
		#Full Screen
        props = WindowProperties.getDefault()
        w=base.pipe.getDisplayWidth()
        h=base.pipe.getDisplayHeight()
        props.setSize(w,h)
        props.setFullscreen(True)
        props.setCursorHidden(True)
        base.win.requestProperties(props) 

		# Load World
        self.environ = loader.loadModel("models/world.egg")      
        self.environ.reparentTo(render)
        self.environ.setPos(0,0,0)
        
        #Load Sky
        self.sky = loader.loadModel("models/clouds.egg")
        self.sky.reparentTo(render)
        self.sky.setPos(60,0,-450)
        
        
        # Create Player Car
        carStartPos = self.environ.find("**/start_point").getPos()
        self.car = Actor("models/carnsx")
        self.car.reparentTo(render)
        self.car.setScale(0.25)
        #self.car.place()
        self.car.setPos(carStartPos)
        
        # Create Enemy Car 1
        enemyCarStartPos1 = (-108,-1,-.5)
        self.car1 = Actor("models/enemy_cars/monstercar/carmonster")
        self.car1.reparentTo(render)
        self.car1.setScale(0.25)
        #self.car1.place()
        self.car1.setPos(enemyCarStartPos1)
        
        # Create Enemy Car 2
        enemyCarStartPos2 = (-104,-26,-.02)
        self.car2 = Actor("models/enemy_cars/yugo/yugo")
        self.car2.reparentTo(render)
        self.car2.setScale(0.15)
        #self.car2.place()
        self.car2.setPos(enemyCarStartPos2)
        
        # Create Enemy Car 3
        enemyCarStartPos3 = (-111,-26,0)
        self.car3 = Actor("models/enemy_cars/truck/cartruck")
        self.car3.reparentTo(render)
        self.car3.setScale(0.25)
        #self.car3.place()
        self.car3.setPos(enemyCarStartPos3)
        
        # Create Enemy Car 4
        enemyCarStartPos4 = (-111,-2,-.5)
        self.car4 = Actor("models/enemy_cars/truck/cartruck-purple")
        self.car4.reparentTo(render)
        self.car4.setScale(0.25)
        #self.car4.place()
        self.car4.setPos(enemyCarStartPos4)
        

        # Create a floater object.  We use the "floater" as a temporary
        # variable in a variety of calculations.
        
        self.floater = NodePath(PandaNode("floater"))
        self.floater.reparentTo(render)

        # Accept the control keys for movement and rotation

        self.accept("escape", sys.exit)
        self.accept("a", self.setKey, ["cam-left",1])
        self.accept("s", self.setKey, ["cam-right",1])
        self.accept("arrow_up",self.setKey, ["forward",1])
        self.accept("arrow_left",self.setKey, ["left",1])
        self.accept("arrow_down",self.setKey, ["back",1])
        self.accept("arrow_right",self.setKey, ["right",1])
        self.accept("a-up", self.setKey, ["cam-left",0])
        self.accept("s-up", self.setKey, ["cam-right",0])
        self.accept("arrow_up-up",self.setKey, ["forward",0])
        self.accept("arrow_left-up",self.setKey, ["left",0])
        self.accept("arrow_right-up",self.setKey, ["right",0])
        self.accept("arrow_down-up",self.setKey, ["back",0])
#.........这里部分代码省略.........
开发者ID:manandhawan,项目名称:Bumping-Cars,代码行数:103,代码来源:main.py


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