Python kivy.animation.Animation.stop_all() Examples
The following are 11
code examples of kivy.animation.Animation.stop_all().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
kivy.animation.Animation
, or try the search function
.
Example #1
Source File: canvas3d.py From kivy3dgui with MIT License | 5 votes |
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)
Example #2
Source File: canvas3d.py From kivy3dgui with MIT License | 5 votes |
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)
Example #3
Source File: canvas3d.py From kivy3dgui with MIT License | 5 votes |
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)
Example #4
Source File: canvas3d.py From kivy3dgui with MIT License | 5 votes |
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)
Example #5
Source File: slidingpanel.py From KivyMD with MIT License | 5 votes |
def toggle(self): Animation.stop_all(self, 'x') anim = self.animation_for_toggling_state() self._open = not self._open anim.start(self)
Example #6
Source File: interpreter.py From Pyonic-interpreter with GNU General Public License v3.0 | 5 votes |
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()
Example #7
Source File: videoplayer.py From Tickeys-linux with MIT License | 5 votes |
def _show_bubble(self): self.alpha = 1 Animation.stop_all(self, 'alpha')
Example #8
Source File: videoplayer.py From Tickeys-linux with MIT License | 5 votes |
def _show_bubble(self): self.alpha = 1 Animation.stop_all(self, 'alpha')
Example #9
Source File: slidingpanel.py From Blogs-Posts-Tutorials with MIT License | 5 votes |
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
Example #10
Source File: scrollview.py From Tickeys-linux with MIT License | 4 votes |
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)
Example #11
Source File: scrollview.py From Tickeys-linux with MIT License | 4 votes |
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)