本文整理汇总了Python中WorldEditor.gizmoClick方法的典型用法代码示例。如果您正苦于以下问题:Python WorldEditor.gizmoClick方法的具体用法?Python WorldEditor.gizmoClick怎么用?Python WorldEditor.gizmoClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldEditor
的用法示例。
在下文中一共展示了WorldEditor.gizmoClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onKeyEvent
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import gizmoClick [as 别名]
def onKeyEvent( self, isDown, key, modifiers ):
if not WorldEditor.cursorOverGraphicsWnd():
return 0
if key == KEY_RIGHTMOUSE:
if ( not self.rightMouseButtonDown ) and isDown:
self.rightMouseButtonDown = 1
self.mouseMoved = 0
elif self.rightMouseButtonDown and not isDown:
self.rightMouseButtonDown = 0
if not self.mouseMoved:
self.onRightMouse()
handled = 0
if self.avatarMode and key == KEY_Q:
self.qDown = isDown
self.eDown = 0
handled = 1
if self.avatarMode and key == KEY_E:
self.eDown = isDown
self.qDown = 0
handled = 1
if not handled:
handled = WorldEditor.camera().handleKeyEvent( isDown, key, modifiers )
if not handled and isDown:
handled = self.ownKeyEvent( key, modifiers )
if not handled and WorldEditor.tool() != None:
handled = WorldEditor.tool().handleKeyEvent( isDown, key, modifiers )
if not handled and isDown and key == KEY_LEFTMOUSE and self.objInfo.overGizmo:
WorldEditor.gizmoClick()
handled = 1
return handled
示例2: onLeftMouse
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import gizmoClick [as 别名]
def onLeftMouse( self ):
self.clickX = 0
self.clickY = 0
# first see if there's a gizmo in the house
if self.objInfo.overGizmo:
# if so, let it take care of things
WorldEditor.gizmoClick()
return
if not self.mouseRevealer.size:
# nothing to click on, start a marquee selection. This will take
# care of clearing the selection if it's only a click.
self.startDragSelect()
return
# Check if control is held down, it indicates that we want to toggle
# what's pointed to in/out of the selection
if (WorldEditor.isKeyDown( KEY_LCONTROL ) or WorldEditor.isKeyDown( KEY_RCONTROL )):
# if we're pointing at a subset of the selection
if set_issubset( self.selection, self.mouseRevealer):
# remove the subset
self.selection.rem( self.mouseRevealer )
self.selUpdate()
return
else:
# add the mouseRevealer to the selection
set_union( self.selection, self.mouseRevealer )
self.selUpdate()
return
else:
# if the selection is totally different to what's under the mouse
# specifically, if we're only pointing at a subset of the
# selection, we don't want to set the selection to that, we want
# to drag it instead (which happens below )
#if not set_intersection_new( self.selection, self.mouseRevealer).size:
if not set_issubset( self.selection, self.mouseRevealer ):
# set the selection to what's under the mouse
set_assign( self.selection, self.mouseRevealer )
self.selUpdate()
# nothing under the mouse, bail
if not self.selection.size:
return
if not WorldEditor.getOptionInt( "dragOnSelect" ):
if not WorldEditor.isKeyDown( KEY_V ):
return
# ok, it's drag time
self.dragging = 1