本文整理汇总了Python中pandac.PandaModules.WindowProperties.setCursorHidden方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setCursorHidden方法的具体用法?Python WindowProperties.setCursorHidden怎么用?Python WindowProperties.setCursorHidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.setCursorHidden方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildInGameMenu
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def buildInGameMenu(self):
props = WindowProperties()
props.setCursorHidden(False)
base.win.requestProperties(props)
resume_button = DirectButton(text = "Resume", scale = .1, command = (lambda: self.switchGameMode(PLAY)),
rolloverSound=None)
main_menu_button = DirectButton(text = "Main Menu", scale = .1, command = self.b,
rolloverSound=None)
options_button = DirectButton(text = "Options", scale = .1, command = self.b,
rolloverSound=None)
exit_button = DirectButton(text = "Exit", scale = .1, command = exit,
rolloverSound=None)
BUTTON_SPACING = .2
BUTTON_HEIGHT = resume_button.getSy()
button_positions = self.evenButtonPositions(BUTTON_SPACING, BUTTON_HEIGHT, 4)
resume_button.setPos(Vec3(0, 0, button_positions[0]))
main_menu_button.setPos(Vec3(0, 0, button_positions[1]))
options_button.setPos(Vec3(0, 0, button_positions[2]))
exit_button.setPos(Vec3(0, 0, button_positions[3]))
self.gui_elements.append(resume_button)
self.gui_elements.append(main_menu_button)
self.gui_elements.append(options_button)
self.gui_elements.append(exit_button)
示例2: toggleMouseLook
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def toggleMouseLook():
global _MOUSELOOK
_MOUSELOOK = not _MOUSELOOK
props = WindowProperties()
props.setCursorHidden(_MOUSELOOK)
base.win.requestProperties(props)
return _MOUSELOOK
示例3: __init__
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def __init__(self, useJOD=None):
"""
@keyword useJOD: connected to actual drumpads and spinners to read from (default: read from config.prc)
@type useJOD: bool
"""
self.configPath = Filename("/c/jamoconfig.txt")
self.logPath = Filename("/c/jamoconfig.log")
self.clearConfig()
self.simulate()
self.log = sys.stdout
self.configMissing = 0
self.hardwareChanged = 0
if (useJOD==None):
useJOD = base.config.GetBool("want-jamodrum", True)
self.useJOD = useJOD
if (useJOD):
self.setLog(self.logPath)
self.devindices = range(1,base.win.getNumInputDevices())
self.readConfigFile(self.configPath)
self.prepareDevices()
props = WindowProperties()
props.setCursorHidden(1)
if (sys.platform == "win32"):
props.setZOrder(WindowProperties.ZTop)
base.win.requestProperties(props)
self.setLog(None)
示例4: activate
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def activate(self, position = Vec3(5.0, 5.0, 5.0)):
print "Activating FreeLook Camera"
# No moar cursor!
wp = WindowProperties()
wp.setCursorHidden(True)
# does not exist panda 1.3.2 / but is reqired for osx-mouse movement
try: wp.setMouseMode(WindowProperties.MAbsolute)
except: pass
base.win.requestProperties(wp)
# initialize camera
base.camLens.setFov(70) # field of view
base.camera.reparentTo(base.render) # attach it to the render
## set position
base.camera.setPos(position)
base.camera.setR(0)
# initialize mouse controls
## walking and stopping if input is lost
self.accept("s" , self.set_walk, [self.BACK])
self.accept("s-up" , self.set_walk, [self.STOP])
self.accept("w" , self.set_walk, [self.FORWARD])
self.accept("w-up" , self.set_walk, [self.STOP])
self.accept("d" , self.set_strafe, [self.RIGHT])
self.accept("d-up" , self.set_strafe, [self.STOP])
self.accept("a" , self.set_strafe, [self.LEFT])
self.accept("a-up" , self.set_strafe, [self.STOP])
# initialize camera task
base.taskMgr.add(self.update, "update_camera_task")
示例5: buildMainMenu
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def buildMainMenu(self):
props = WindowProperties()
props.setCursorHidden(False)
base.win.requestProperties(props)
start_game_button = DirectButton(text = "Start", scale = .1,
command = self.b)
select_level_button = DirectButton(text = "Select Level", scale = .1,
command = self.b)
game_options_button = DirectButton(text = "Options", scale = .1,
command = self.b)
exit_button = DirectButton(text = "Exit", scale = .1,
command = exit)
BUTTON_SPACING = .2
BUTTON_HEIGHT = start_game_button.getSy()
button_positions = self.evenButtonPositions(BUTTON_SPACING, BUTTON_HEIGHT)
start_game_button.setPos(Vec3(0, 0, button_positions[0]))
select_level_button.setPos(Vec3(0, 0, button_positions[1]))
game_options_button.setPos(Vec3(0, 0, button_positions[2]))
exit_button.setPos(Vec3(0, 0, button_positions[3]))
self.gui_elements.append(start_game_button)
self.gui_elements.append(select_level_button)
self.gui_elements.append(game_options_button)
self.gui_elements.append(exit_button)
示例6: hide_cursor
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def hide_cursor():
"""set the Cursor invisible"""
props = WindowProperties()
props.setCursorHidden(True)
# somehow the window gets undecorated after hiding the cursor
# so we reset it here to the value we need
#props.setUndecorated(settings.fullscreen)
base.win.requestProperties(props)
示例7: show_cursor
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def show_cursor():
props = WindowProperties()
props.setCursorHidden(False)
# set the filename to the mouse cursor
# at the time the realization is valid for Windows only
win = "assets/gui/Cursor.cur"
props.setCursorFilename(win)
base.win.requestProperties(props)
示例8: _init_graphics
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def _init_graphics(self):
base.disableMouse()
props = WindowProperties()
props.setCursorHidden(True)
base.win.requestProperties(props)
base.setFrameRateMeter(True)
render.setShaderAuto()
render.setAntialias(AntialiasAttrib.MAuto)
示例9: __exitWheel
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def __exitWheel(self, event):
# Window properties
props = WindowProperties()
props.setCursorHidden(False)
base.win.requestProperties(props)
# Stop tracking our mouse pointer
taskMgr.remove('MATColorWheel-mouse')
示例10: togglePause
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def togglePause(self):
print ("pause pressed")
if MyApp.paused:
self.makeMouseRelative()
MyApp.paused = False
else:
props = WindowProperties() # initiates window node
props.setCursorHidden(False) # cursor shows
props.setMouseMode(WindowProperties.M_absolute) # cursor moves
self.win.requestProperties(props) # window accepts changes
MyApp.paused = True
示例11: setPlanar
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def setPlanar():
for citizen in citizenIndex:
location = citizen.getLocation()
citizen.glide(location)
global mode
mode = 1
LerpPosInterval(base.camera, 1, VBase3(0, 0, 75), fluid = 1).start()
LerpHprInterval(base.camera, 1, VBase3(0, -90, 0), fluid = 1).start()
#base.camera.setPosHpr(0, 0, 75, 0, -90, 0)
props = WindowProperties()
props.setCursorHidden(False)
base.win.requestProperties(props)
示例12: show_cursor
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def show_cursor():
"""set the Cursor visible again"""
props = WindowProperties()
props.setCursorHidden(False)
# set the filename to the mouse cursor
x11 = "Cursor.x11"
win = "Cursor.ico"
if sys.platform.startswith("linux"):
props.setCursorFilename(x11)
else:
props.setCursorFilename(win)
base.win.requestProperties(props)
示例13: beginGame
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def beginGame(self):
self.textObject.destroy()
self.imageObject.destroy()
self.b.destroy()
props = WindowProperties()
props.setCursorHidden(True)
base.win.requestProperties(props)
self.taskMgr.add(self.moveForward, "MoveForward")
self.accept("mouse1",self.jump)
self.textScore = OnscreenText(text = '\1red\1\1slant\1Score : 0', pos = (-0.8, 0.8), scale = 0.1)
self.textTimer = OnscreenText(text = '\1red\1\1slant\1Time Left : 2:00', pos = (-0.8, 0.7), scale = 0.1)
print 'GameBegin'
示例14: show_cursor
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def show_cursor():
"""set the Cursor visible again"""
props = WindowProperties()
props.setCursorHidden(False)
# set the filename to the mouse cursor
#x11 = os.path.join("data", "Cursor.x11")
#win = os.path.join("data", "Cursor.ico")
#if sys.platform.startswith("linux"):
# props.setCursorFilename(x11)
#else:
# props.setCursorFilename(win)
#props.setUndecorated(settings.fullscreen)
base.win.requestProperties(props)
示例15: start_map
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setCursorHidden [as 别名]
def start_map(self):
try:
self.r_region.setActive(0)
self.ih_node.detach_node()
except:
# probably self.r_region isn't set because
# we never loaded it (map arg on cmd line)
pass
self.lp = LocalPlayer(self.map, self.showbase)
taskMgr.add(self.map.world.update, 'worldUpdateTask')
props = WindowProperties()
props.setCursorHidden(True)
self.win.requestProperties(props)
print self.render.analyze()