本文整理汇总了Python中pygame.K_o方法的典型用法代码示例。如果您正苦于以下问题:Python pygame.K_o方法的具体用法?Python pygame.K_o怎么用?Python pygame.K_o使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygame
的用法示例。
在下文中一共展示了pygame.K_o方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_o [as 别名]
def update(self, frameNumber, editor):
for event, pos in editor.context.events:
if event.type == pygame.KEYDOWN:
bone = editor.getActiveBone()
key = event.key
if key == pygame.K_i:
if bone:
if event.mod & pygame.KMOD_ALT:
if bone.name in self.frames[frameNumber].keys:
del self.frames[frameNumber].keys[bone.name]
else:
key = self.frames[frameNumber].getBoneKey(bone.name)
copyKeyData(bone, key)
self.dirty = True
elif key == pygame.K_o:
if bone:
data = self.getBoneData(bone.name)
data.repeat = not data.repeat
self.dirty = True
elif key == pygame.K_p:
if bone:
data = self.getBoneData(bone.name)
data.reversed = not data.reversed
self.dirty = True
示例2: handle_event
# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_o [as 别名]
def handle_event(self, event: pygame.event.EventType) -> None:
"""
Handle pygame events for moving and zooming in the displayed area.
:param event: a pygame event
"""
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_l:
self.scaling *= 1 / self.SCALING_FACTOR
if event.key == pygame.K_o:
self.scaling *= self.SCALING_FACTOR
if event.key == pygame.K_m:
self.centering_position[0] -= self.MOVING_FACTOR
if event.key == pygame.K_k:
self.centering_position[0] += self.MOVING_FACTOR