本文整理汇总了Python中panda3d.core.WindowProperties.getFullscreen方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.getFullscreen方法的具体用法?Python WindowProperties.getFullscreen怎么用?Python WindowProperties.getFullscreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.getFullscreen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: toggle_fullscreen
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getFullscreen [as 别名]
def toggle_fullscreen(self):
""" Toggles fullscreen mode."""
props = WindowProperties(self.win.getProperties())
if props.getFullscreen():
props.setSize(*self.size)
props.setFullscreen(False)
else:
w = self.pipe.getDisplayWidth()
h = self.pipe.getDisplayHeight()
props.setSize(w, h)
props.setFullscreen(True)
self.win.requestProperties(props)
示例2: toggleFullScreen
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getFullscreen [as 别名]
def toggleFullScreen(self):
props = WindowProperties( self.win.getProperties() )
if not props.getFullscreen():
props.setSize(int(game_settings['screen_resolution'][0]),int(game_settings['screen_resolution'][1]))
props.setFullscreen(True)
else:
props.setFullscreen(False)
self.win.requestProperties(props)
game_settings['full_screen'] = not game_settings['full_screen']
if self.configForm:
self.configForm.refreshSettings()
messenger.send('window-event', [self])
示例3: __init__
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import getFullscreen [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