파이썬[Python]: kivy - AnimationTransition 클래스 - kv
kivy.animation 모듈 - AnimationTransition 클래스(class)
/// 설명
애니메이션 객체에 사용되어지는 애니메이션 모음입니다.
참고: animation to gesture 모듈 목록
※ 형식
AnimationTransition
reference
https://kivy.org/doc/stable/api-kivy.animation.html
참고: animation to gesture 모듈 목록
※ 형식
AnimationTransition
reference
https://kivy.org/doc/stable/api-kivy.animation.html
/// 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | import kivy kivy.require('2.0.0') from kivy.app import App from kivy.lang import Builder from kivy.core.window import Window from kivy.animation import Animation, AnimationTransition Window.clearcolor = (.5, .0, .5, .1) kv = ''' FloatLayout: Button: text: 'Animation!!!' size_hint: (None, None) size: (100, 100) on_press: app.bt_pressed(self) ''' class TestApp(App): def bt_pressed(self, button_instance): # getting window size window_width, window_height = Window.size anmt = Animation(y=window_height - 100, transition=AnimationTransition.in_bounce) # first move(up) anmt += Animation(x=window_width - 100, transition=AnimationTransition.out_circ) # second move(right) anmt += Animation(y=0, transition=AnimationTransition.in_quint) # third move(down) anmt += Animation(x=0, transition=AnimationTransition.in_back) # forth move(left) return anmt.start(button_instance) def build(self): return Builder.load_string(kv) TestApp().run() | cs |
/// 출력
* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)
– 당신을 응원합니다. –
댓글
댓글 쓰기