当前位置: 首页>>代码示例>>Python>>正文


Python animation.Animation方法代码示例

本文整理汇总了Python中kivy.animation.Animation方法的典型用法代码示例。如果您正苦于以下问题:Python animation.Animation方法的具体用法?Python animation.Animation怎么用?Python animation.Animation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.animation的用法示例。


在下文中一共展示了animation.Animation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def start( self ) :

        self.pos = ( 
            self.root_layout.width/2 - self.width/2, 
            self.root_layout.height+self.height-dp(56)
        )

        animation = Animation( 
            y=self.root_layout.height-2*self.height, 
            duration=self.duracy
        )
        animation.start( self )         

        self.angle = 0
        self._hex = 0
        self._color = 0, 0, 0, 1 
        self.root_layout.add_widget( self )
        Clock.schedule_interval( self.update_animation, 0.04 ) 
开发者ID:curzel-it,项目名称:kivy-material-ui,代码行数:20,代码来源:scroll.py

示例2: open

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def open(self, *largs):
		'''Show the view window from the :attr:`attach_to` widget. If set, it
		will attach to the nearest window. If the widget is not attached to any
		window, the view will attach to the global
		:class:`~kivy.core.window.Window`.
		'''
		if self._window is not None:
			Logger.warning('ModalView: you can only open once.')
			return self
		# search window
		self._window = self._search_window()
		if not self._window:
			Logger.warning('ModalView: cannot open view, no window found.')
			return self
		self._window.add_widget(self)
		self._window.bind(on_resize=self._align_center,
		                  on_keyboard=self._handle_keyboard)
		self.center = self._window.center
		self.bind(size=self._update_center)
		a = Animation(_anim_alpha=1., d=self._anim_duration)
		a.bind(on_complete=lambda *x: self.dispatch('on_open'))
		a.start(self)
		return self 
开发者ID:kivymd,项目名称:KivyMD,代码行数:25,代码来源:dialog.py

示例3: on_activated

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def on_activated(self, instance, activated):
        if not activated:
            self.grect.size = 0, 0
            if self.at_bottom:
                anim = Animation(top=0, t='out_quad', d=.3)
            else:
                anim = Animation(y=self.height, t='out_quad', d=.3)
            anim.bind(on_complete=self.animation_close)
            anim.start(self.layout)
            self.widget = None
            self.widget_info = False
        else:
            self.win.add_widget(self)
            Logger.info('Inspector: inspector activated')
            if self.at_bottom:
                Animation(top=60, t='out_quad', d=.3).start(self.layout)
            else:
                Animation(y=self.height - 60, t='out_quad', d=.3).start(
                    self.layout) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:21,代码来源:inspector.py

示例4: start

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def start(self, manager):
        '''(internal) Starts the transition. This is automatically
        called by the :class:`ScreenManager`.
        '''
        if self.is_active:
            raise ScreenManagerException('start() is called twice!')
        self.manager = manager
        self._anim = Animation(d=self.duration, s=0)
        self._anim.bind(on_progress=self._on_progress,
                        on_complete=self._on_complete)

        self.add_screen(self.screen_in)
        self.screen_in.transition_progress = 0.
        self.screen_in.transition_state = 'in'
        self.screen_out.transition_progress = 0.
        self.screen_out.transition_state = 'out'
        self.screen_in.dispatch('on_pre_enter')
        self.screen_out.dispatch('on_pre_leave')

        self.is_active = True
        self._anim.start(self)
        self.dispatch('on_progress', 0) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:24,代码来源:screenmanager.py

示例5: open

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def open(self, *largs):
        '''Show the view window from the :attr:`attach_to` widget. If set, it
        will attach to the nearest window. If the widget is not attached to any
        window, the view will attach to the global
        :class:`~kivy.core.window.Window`.
        '''
        if self._window is not None:
            Logger.warning('ModalView: you can only open once.')
            return self
        # search window
        self._window = self._search_window()
        if not self._window:
            Logger.warning('ModalView: cannot open view, no window found.')
            return self
        self._window.add_widget(self)
        self._window.bind(
            on_resize=self._align_center,
            on_keyboard=self._handle_keyboard)
        self.center = self._window.center
        self.bind(size=self._update_center)
        a = Animation(_anim_alpha=1., d=self._anim_duration)
        a.bind(on_complete=lambda *x: self.dispatch('on_open'))
        a.start(self)
        return self 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:26,代码来源:modalview.py

示例6: stop_spinning

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def stop_spinning(self, *args):
		'''Stop spinning the progress spinner. Ignores all positional args
		for easy binding.

		If you intend to keep the spinner around, you should stop it when
		not using it and restart it when needed again.
		'''
		if self._spinning:
			if self._next:
				if isinstance(self._next, Animation):
					self._next.cancel(self)
				else:
					self._next.cancel()
			Clock.unschedule(self._update)
			Clock.unschedule(self._rotate)
			self._angle_start = self._angle_end = 0
			self._spinning = False 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:19,代码来源:__init__.py

示例7: add_to_bottom_right

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def add_to_bottom_right( self, parent ) : 

        nx = parent.width-self.diameter*1.2
        ny = self.diameter*0.3

        parent.bind( size=self._repose )
        parent.add_widget( self )

        duracy = self.animation_duracy if self.entrance != '' else 0

        if duracy > 0 :
            if self.entrance == 'down'  : self.pos = [ nx, -self.height ]
            if self.entrance == 'up'    : self.pos = [ nx, self.pos[1]+self.height ]
            if self.entrance == 'left'  : self.pos = [ -self.width, ny ]
            if self.entrance == 'right' : self.pos = [ +self.width, ny ]

            animation = Animation( x=nx, y=ny, duration=duracy )
            animation.start( self ) 
        else :
            self.pos = nx, ny
        self.parent = parent 
开发者ID:curzel-it,项目名称:kivy-material-ui,代码行数:23,代码来源:flatui.py

示例8: open

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def open(self, *largs):
        '''Show the view window from the :attr:`attach_to` widget. If set, it
        will attach to the nearest window. If the widget is not attached to any
        window, the view will attach to the global
        :class:`~kivy.core.window.Window`.
        '''
        if self._window is not None:
            Logger.warning('ModalView: you can only open once.')
            return self
        # search window
        self._window = self._search_window()
        if not self._window:
            Logger.warning('ModalView: cannot open view, no window found.')
            return self
        self._window.add_widget(self)
        self._window.bind(on_resize=self._align_center,
                          on_keyboard=self._handle_keyboard)
        self.center = self._window.center
        self.bind(size=self._align_center)
        a = Animation(_anim_alpha=1., d=self._anim_duration)
        a.bind(on_complete=lambda *x: self.dispatch('on_open'))
        a.start(self)
        return self 
开发者ID:kiok46,项目名称:Blogs-Posts-Tutorials,代码行数:25,代码来源:dialog.py

示例9: dismiss

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def dismiss(self, *largs, **kwargs):
		'''Close the view if it is open. If you really want to close the
		view, whatever the on_dismiss event returns, you can use the *force*
		argument:
		::

			view = ModalView(...)
			view.dismiss(force=True)

		When the view is dismissed, it will be faded out before being
		removed from the parent. If you don't want animation, use::

			view.dismiss(animation=False)

		'''
		if self._window is None:
			return self
		if self.dispatch('on_dismiss') is True:
			if kwargs.get('force', False) is not True:
				return self
		if kwargs.get('animation', True):
			Animation(_anim_alpha=0., d=self._anim_duration).start(self)
		else:
			self._anim_alpha = 0
			self._real_remove_widget()
		return self 
开发者ID:kivymd,项目名称:KivyMD,代码行数:28,代码来源:dialog.py

示例10: show

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def show(self, desc):
        self.text = desc
        anim = Animation(y = metrics.dp(50), t = 'in_out_expo')
        anim.start(self)
        Clock.schedule_once(self.exit, 5) 
开发者ID:anselm94,项目名称:segreto-3,代码行数:7,代码来源:widget.py

示例11: exit

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def exit(self, dt):
        Clock.unschedule(self.exit)
        anim = Animation(y = metrics.dp(-50), t = 'in_out_expo')
        anim.start(self) 
开发者ID:anselm94,项目名称:segreto-3,代码行数:6,代码来源:widget.py

示例12: start_display

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def start_display(self, touch):
        touch.grab(self)
        a = Animation(circle_progress=1, d=self.creation_timeout)
        a.bind(on_complete=self.open_menu)
        touch.ud['animation'] = a
        a.start(self) 
开发者ID:kivy-garden,项目名称:garden.modernmenu,代码行数:8,代码来源:__init__.py

示例13: dismiss

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def dismiss(self):
        a = Animation(opacity=0)
        a.bind(on_complete=self._remove)
        a.start(self) 
开发者ID:kivy-garden,项目名称:garden.modernmenu,代码行数:6,代码来源:__init__.py

示例14: frontal

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def frontal(self):
        Animation(rotate=(0.0, 1.0, 0.0, 0.0), translate=(-5, 0, -110), duration=1.0).start(self.board)
        for i, n in enumerate(self.red_n):
            (Animation(translate=(-30,20,-40), duration=(i+1)/(self.delay*1.0)) +
            Animation(translate=n["front"], rotate=(0,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"])
        for i, n in enumerate(self.green_n):
            (Animation(translate=(30,-20,-40), duration=(i+1)/(self.delay*1.0)) +
            Animation(translate=n["front"], rotate=(0,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"]) 
开发者ID:kpiorno,项目名称:kivy3dgui,代码行数:10,代码来源:checker.py

示例15: perspective

# 需要导入模块: from kivy import animation [as 别名]
# 或者: from kivy.animation import Animation [as 别名]
def perspective(self):
        Animation(rotate=(-90.0, 1.0, 0.0, 0.0), translate=(-5, -25, -110),duration=1.0).start(self.board)
        for i, n in enumerate(self.red_n):
            (Animation(translate=(-30,20,-90), duration=(i+1)/(self.delay*1.0)) +
            Animation(translate=n["persp"], rotate=(-90,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"])
        for i, n in enumerate(self.green_n):
            (Animation(translate=(30,-20,-90), duration=(i+1)/(self.delay*1.0)) +
            Animation(translate=n["persp"], rotate=(-90,1.0,0.0,0.0), duration=(i+1)/self.delay+1,t='in_quad')).start(n["node"]) 
开发者ID:kpiorno,项目名称:kivy3dgui,代码行数:10,代码来源:checker.py


注:本文中的kivy.animation.Animation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。