本文整理汇总了Python中pandac.PandaModules.WindowProperties.setFullscreen方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setFullscreen方法的具体用法?Python WindowProperties.setFullscreen怎么用?Python WindowProperties.setFullscreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.setFullscreen方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def set(self, pipe, width, height, fullscreen, embedded):
self.notify.debugStateCall(self)
state = False
self.notify.info('SET')
if self.restrict_to_embedded:
fullscreen = 0
embedded = 1
if embedded:
if base.appRunner.windowProperties:
width = base.appRunner.windowProperties.getXSize()
height = base.appRunner.windowProperties.getYSize()
self.current_pipe = base.pipe
self.current_properties = WindowProperties(base.win.getProperties())
properties = self.current_properties
self.notify.debug('DISPLAY PREVIOUS:')
self.notify.debug(' EMBEDDED: %s' % bool(properties.getParentWindow()))
self.notify.debug(' FULLSCREEN: %s' % bool(properties.getFullscreen()))
self.notify.debug(' X SIZE: %s' % properties.getXSize())
self.notify.debug(' Y SIZE: %s' % properties.getYSize())
self.notify.debug('DISPLAY REQUESTED:')
self.notify.debug(' EMBEDDED: %s' % bool(embedded))
self.notify.debug(' FULLSCREEN: %s' % bool(fullscreen))
self.notify.debug(' X SIZE: %s' % width)
self.notify.debug(' Y SIZE: %s' % height)
if self.current_pipe == pipe and bool(self.current_properties.getParentWindow()) == bool(embedded) and self.current_properties.getFullscreen() == fullscreen and self.current_properties.getXSize() == width and self.current_properties.getYSize() == height:
self.notify.info('DISPLAY NO CHANGE REQUIRED')
state = True
else:
properties = WindowProperties()
properties.setSize(width, height)
properties.setFullscreen(fullscreen)
properties.setParentWindow(0)
if embedded:
if base.appRunner.windowProperties:
properties = base.appRunner.windowProperties
original_sort = base.win.getSort()
if self.resetWindowProperties(pipe, properties):
self.notify.debug('DISPLAY CHANGE SET')
properties = base.win.getProperties()
self.notify.debug('DISPLAY ACHIEVED:')
self.notify.debug(' EMBEDDED: %s' % bool(properties.getParentWindow()))
self.notify.debug(' FULLSCREEN: %s' % bool(properties.getFullscreen()))
self.notify.debug(' X SIZE: %s' % properties.getXSize())
self.notify.debug(' Y SIZE: %s' % properties.getYSize())
if bool(properties.getParentWindow()) == bool(embedded) and properties.getFullscreen() == fullscreen and properties.getXSize() == width and properties.getYSize() == height:
self.notify.info('DISPLAY CHANGE VERIFIED')
state = True
else:
self.notify.warning('DISPLAY CHANGE FAILED, RESTORING PREVIOUS DISPLAY')
self.restoreWindowProperties()
else:
self.notify.warning('DISPLAY CHANGE FAILED')
self.notify.warning('DISPLAY SET - BEFORE RESTORE')
self.restoreWindowProperties()
self.notify.warning('DISPLAY SET - AFTER RESTORE')
base.win.setSort(original_sort)
base.graphicsEngine.renderFrame()
base.graphicsEngine.renderFrame()
return state
示例2: setFullscreen
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def setFullscreen(self, settings):
"""Set the window to fullscreen or windowed mode depending on the
configuration in the settings variable"""
props = WindowProperties()
props.setFullscreen(settings.fullscreen)
props.setUndecorated(settings.fullscreen)
if settings.fullscreen:
props.setSize(settings.windowSize[0], settings.windowSize[1])
base.win.requestProperties(props)
base.taskMgr.step()
示例3: makeGameEngine
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def makeGameEngine(self):
''' Creates a new game engine based on settings in GameSettings.
Information for this came from here
http://panda3d.org/phpbb2/viewtopic.php?t=2848'''
LOG.debug("[GXMgr] Building game engine")
# Temporary
# TODO: Fix this
props = WindowProperties()
props.setFullscreen(False)
props.setUndecorated(False)
#screenx = int(base.pipe.getDisplayWidth()/2) - (int(self.ScreenWidth)/2)
#screeny = int(base.pipe.getDisplayHeight()/2) - (int(self.ScreenHeight)/2)
#self.TempScreenSizeRX = int(self.ScreenWidth)
#self.TempScreenSizeRY = int(self.ScreenHeight)
props.setOrigin(100,100)
props.setSize(1024,768)
base.win.requestProperties(props)
# This was the old way that no longer works - I don't know why
## Create a new FrameBufferProperties object using our settings
#fbProps = FrameBufferProperties()
#fbProps.addProperties(FrameBufferProperties.getDefault())
#fbProps.setMultisamples(GameSettings().antiAlias)
#fbProps.setAlphaBits(GameSettings().alphaBits)
#fbProps.setDepthBits(GameSettings().colorDepth)
#fbProps.setColorBits(24)
#
## Create a WindowProperties object
#winProps = WindowProperties( base.win.getProperties() )
#winProps.setFullscreen(GameSettings().fullscreen)
#winProps.setUndecorated(GameSettings().fullscreen)
#winProps.setSize(GameSettings().xRes,GameSettings().yRes)
#winProps.setTitle('PSG - Project Space Game: Alpha')
#
## Create the engine
#base.graphicsEngine.makeOutput(base.pipe, # GraphicsPipe
# 'mainGameOutput', # Name
# 0, # Sort
# fbProps, # FrameBufferProperties
# winProps, # WindowProperties
# GraphicsPipe.BFRequireWindow | GraphicsPipe.BFFbPropsOptional, # Flags
# base.win.getGsg()) # GraphicsStateGaurdian
##base.openMainWindow(props=winProps, gsg=base.win.getGsg(), keepCamera=1)
#base.openMainWindow()
#base.graphicsEngine.openWindows()
#base.win.requestProperties(winProps)
## The following code should proabably be moved somewhere else
#showFPS = GameSettings().showFPS
#base.setFrameRateMeter(showFPS)
示例4: ToggleFullScreen
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def ToggleFullScreen(self):
fullscreen = not base.win.isFullscreen()
props = WindowProperties( base.win.getProperties() )
if(not fullscreen):
props.setFullscreen(False)
props.setSize(850, 480)
else:
props.setFullscreen(True)
w = base.pipe.getDisplayWidth()
h = base.pipe.getDisplayHeight()
if w and h:
props.setSize(w,h)
else:
props.setSize(850, 480)
base.win.requestProperties(props)
messenger.send('window-event',[base.win])
示例5: setupWindow
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [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')
示例6: toggleFullscreen
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def toggleFullscreen():
wp = WindowProperties()
wp.setFullscreen(not base.win.isFullscreen())
base.win.requestProperties(wp)
示例7: setResolution
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def setResolution(x=800, y=600, fullScreen=False):
wp = WindowProperties()
wp.setSize(x,y)
wp.setFullscreen(fullScreen)
base.win.requestProperties(wp)
示例8: set_fullscreen
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setFullscreen [as 别名]
def set_fullscreen(self):
winProps = WindowProperties()
self.isFullscreen = not self.isFullscreen
winProps.setFullscreen(self.isFullscreen)
self.win.requestProperties(winProps)