本文整理汇总了Python中arrow.Arrow.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python Arrow.destroy方法的具体用法?Python Arrow.destroy怎么用?Python Arrow.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arrow.Arrow
的用法示例。
在下文中一共展示了Arrow.destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Slide
# 需要导入模块: from arrow import Arrow [as 别名]
# 或者: from arrow.Arrow import destroy [as 别名]
class Slide(UserState):
def __init__(self, app, hand, time=max_slide_wait, arrow=None):
UserState.__init__(self, app, hand.user)
self.hand = hand
self.start_time = clock()
self.time = time
base.slide(hand.side_sign)
self.arrow = arrow
if not self.arrow:
self.arrow = Arrow(self.app, hand.user, hand.side)
self.arrow.play_trigger()
self.arrow.update(base.nui.users)
print 'time', time
self.timer(time, self.timeout)
def hand_move(self, hand):
if hand.side == self.hand.side and not self.arrow.is_playing:
max_extension = 0.55
pos = hand.positions[-1].x * hand.side_sign
time = max(0.0, min(1.0, (pos - hand_trigger) / (max_extension - hand_trigger)))
self.time = max_slide_wait - time * (max_slide_wait - min_slide_wait)
self.timer(self.time - (clock()-self.start_time), self.timeout)
self.arrow.set_time_at_speed(time)
self.arrow.update(base.nui.users)
UserState.hand_move(self, hand)
def hand_in(self, hand):
if hand.side != self.hand.side:
self.arrow.destroy()
self.next_state(Thumbnails(self.app, self.hand.user))
def hand_out(self, hand):
if hand.side == self.hand.side:
self.arrow.destroy()
self.next_state(Start(self.app))
def lost_user(self):
self.arrow.destroy()
def timeout(self):
self.next_state(Slide(self.app, self.hand, self.time, self.arrow))