本文整理汇总了Python中pandac.PandaModules.WindowProperties.setUndecorated方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setUndecorated方法的具体用法?Python WindowProperties.setUndecorated怎么用?Python WindowProperties.setUndecorated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.setUndecorated方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnInit
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setUndecorated [as 别名]
def OnInit(self):
#prepare and start the p3d-wx hybrid-engine mainloop
self.wxevt_loop = wx.EventLoop()
self.wxevt_old_loop = wx.EventLoop.GetActive()
wx.EventLoop.SetActive(self.wxevt_loop)
base.taskMgr.add(self._mainLoop, "MainLoopTask")
#instantiate and assign the wx UI object
self.win = P3dWxWindow(size=wx.Size(640, 480))
self.SetTopWindow(self.win)
#show the wx window
self.win.Show(True)
# is essential to let make up wx window before P3D stuff
self._mainLoop()
#bind wx events
self.win.Bind(wx.EVT_SIZE, self.onSize)
self.win.Bind(wx.EVT_CLOSE, self.onClose)
self.vetoActivate=False
self.win.Bind(wx.EVT_ACTIVATE, self.onActivate)
#open the p3d window undecorated to use in the wx frame window
wp=WindowProperties().getDefault()
wp.setUndecorated(True)
wp.setOpen(True)
wp.setParentWindow(self.win.getP3DSurface())
wp.setOrigin(0,0)
wp.setForeground(True)
wp.setSize(*self.win.getP3DSurfaceSize())
print ">>>opening p3dsurface"
assert base.openDefaultWindow(props=wp) == True
#
return True
示例2: setFullscreen
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setUndecorated [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 setUndecorated [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: configure
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setUndecorated [as 别名]
def configure(self, widget, event):
if self.showbase != None:
x_offset, y_offset = self.translate_coordinates(widget, 0, 0)
x, y = self.gtk_window.window.get_position()
wp = WindowProperties().getDefault()
wp.setOrigin(x + x_offset, y + y_offset)
wp.setSize(self.get_allocation().width, self.get_allocation().height)
wp.setUndecorated(True)
# apply window property changes to the window
self.showbase.win.requestProperties(wp)
# for debugging purposes turn show the frame rate
# to decide about the interval for calling self.step
# with a gobject timeout
self.showbase.setFrameRateMeter(True)