本文整理汇总了Python中panda3d.core.WindowProperties.setDefault方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setDefault方法的具体用法?Python WindowProperties.setDefault怎么用?Python WindowProperties.setDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.setDefault方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupWindow
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setDefault [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')
示例2: __init__
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setDefault [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)
示例3: loadPrcFileData
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import setDefault [as 别名]
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
BUFFER_EXTRA=3 #used for grass (red)... maybe something extra in the future?