當前位置: 首頁>>代碼示例>>Python>>正文


Python Animation.stop_all方法代碼示例

本文整理匯總了Python中kivy.animation.Animation.stop_all方法的典型用法代碼示例。如果您正苦於以下問題:Python Animation.stop_all方法的具體用法?Python Animation.stop_all怎麽用?Python Animation.stop_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kivy.animation.Animation的用法示例。


在下文中一共展示了Animation.stop_all方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: toggle

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def toggle(self):
		Animation.stop_all(self, 'x')
		anim = self.animation_for_toggling_state()
		self._open = not self._open
		anim.start(self) 
開發者ID:kivymd,項目名稱:KivyMD,代碼行數:7,代碼來源:slidingpanel.py

示例2: pitch

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def pitch(self, value, time):
        self.rotate = [value, 1.0, 0.0, 0.0]
        Animation.stop_all(self)
        Animation(rotate=[0.0, 1.0, 0.0, 0.0], duration=time).start(self) 
開發者ID:kpiorno,項目名稱:kivy3dgui,代碼行數:6,代碼來源:canvas3d.py

示例3: walk

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def walk(self, value, time):
        self.translate = [0.0, 0.0, value]
        Animation.stop_all(self)
        Animation(translate=(0.0, 0.0, 0.0), duration=time).start(self) 
開發者ID:kpiorno,項目名稱:kivy3dgui,代碼行數:6,代碼來源:canvas3d.py

示例4: strafe

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def strafe(self, value, time):
        self.translate = [value, 0.0, 0.0]
        Animation.stop_all(self)
        Animation(translate=(0.0, 0.0, 0.0), duration=time).start(self) 
開發者ID:kpiorno,項目名稱:kivy3dgui,代碼行數:6,代碼來源:canvas3d.py

示例5: up

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def up(self, value, time):
        self.translate = [0.0, value, 0.0]
        Animation.stop_all(self)
        Animation(translate=(0.0, 0.0, 0.0), duration=time).start(self) 
開發者ID:kpiorno,項目名稱:kivy3dgui,代碼行數:6,代碼來源:canvas3d.py

示例6: _dequeue_output_label

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def _dequeue_output_label(self, dt):
        if not self._output_label_queue:
            return

        # print('dequeueing', self._output_label_queue)

        t = time()
        i = 0
        while (time() - t) < 0.005:
            i += 1
            if not self._output_label_queue:
                break
            label_text = self._output_label_queue.pop(0)
            label = self._add_output_label(*label_text, scroll_to=False)
        print('Rendered {} labels in {}'.format(i, time() - t))
        Animation.stop_all(self.scrollview, 'scroll_x', 'scroll_y')
        self.scrollview.scroll_to(label)

        self.dequeue_scheduled.cancel()
        self.dequeue_scheduled = None

        if len(self._output_label_queue) == 0 and self.clear_scheduled:
            self.clear_scheduled.cancel()
            self.clear_scheduled = None
        elif len(self._output_label_queue) > 0:
            self.dequeue_scheduled = Clock.schedule_once(
                self._dequeue_output_label, 0.05)

        if (self.awaiting_label_display_completion and
            len(self._output_label_queue) == 0):
            self.awaiting_label_display_completion = False
            self._execution_complete() 
開發者ID:inclement,項目名稱:Pyonic-interpreter,代碼行數:34,代碼來源:interpreter.py

示例7: _show_bubble

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def _show_bubble(self):
        self.alpha = 1
        Animation.stop_all(self, 'alpha') 
開發者ID:BillBillBillBill,項目名稱:Tickeys-linux,代碼行數:5,代碼來源:videoplayer.py

示例8: toggle

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def toggle(self):
        Animation.stop_all(self, 'x')
        Animation.stop_all(self.shadow, 'color')
        if self._open:
            if self.side == 'left':
                target_x = -1 * self.width
            else:
                target_x = Window.width

            sh_anim = Animation(duration=self.anim_length_open,
                                t=self.animation_t_open,
                                color=[0, 0, 0, 0])
            sh_anim.start(self.shadow)
            self._get_main_animation(duration=self.anim_length_close,
                                     t=self.animation_t_close,
                                     x=target_x,
                                     is_closing=True).start(self)
            self._open = False
        else:
            if self.side == 'left':
                target_x = 0
            else:
                target_x = Window.width - self.width
            Animation(duration=self.anim_length_open, t=self.animation_t_open,
                      color=[0, 0, 0, 0.5]).start(self.shadow)
            self._get_main_animation(duration=self.anim_length_open,
                                     t=self.animation_t_open,
                                     x=target_x,
                                     is_closing=False).start(self)
            self._open = True 
開發者ID:kiok46,項目名稱:Blogs-Posts-Tutorials,代碼行數:32,代碼來源:slidingpanel.py

示例9: update_from_scroll

# 需要導入模塊: from kivy.animation import Animation [as 別名]
# 或者: from kivy.animation.Animation import stop_all [as 別名]
def update_from_scroll(self, *largs):
        '''Force the reposition of the content, according to current value of
        :attr:`scroll_x` and :attr:`scroll_y`.

        This method is automatically called when one of the :attr:`scroll_x`,
        :attr:`scroll_y`, :attr:`pos` or :attr:`size` properties change, or
        if the size of the content changes.
        '''
        if not self._viewport:
            return
        vp = self._viewport

        # update from size_hint
        if vp.size_hint_x is not None:
            vp.width = vp.size_hint_x * self.width
        if vp.size_hint_y is not None:
            vp.height = vp.size_hint_y * self.height

        if vp.width > self.width:
            sw = vp.width - self.width
            x = self.x - self.scroll_x * sw
        else:
            x = self.x
        if vp.height > self.height:
            sh = vp.height - self.height
            y = self.y - self.scroll_y * sh
        else:
            y = self.top - vp.height

        # from 1.8.0, we now use a matrix by default, instead of moving the
        # widget position behind. We set it here, but it will be a no-op most of
        # the time.
        vp.pos = 0, 0
        self.g_translate.xy = x, y

        # New in 1.2.0, show bar when scrolling happens and (changed in 1.9.0)
        # fade to bar_inactive_color when no scroll is happening.
        Clock.unschedule(self._bind_inactive_bar_color)
        self.unbind(bar_inactive_color=self._change_bar_color)
        Animation.stop_all(self, '_bar_color')
        self.bind(bar_color=self._change_bar_color)
        self._bar_color = self.bar_color
        Clock.schedule_once(self._bind_inactive_bar_color, .5) 
開發者ID:BillBillBillBill,項目名稱:Tickeys-linux,代碼行數:45,代碼來源:scrollview.py


注:本文中的kivy.animation.Animation.stop_all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。