Skip to content

Instantly share code, notes, and snippets.

@yaki29
Created December 11, 2016 10:49
Show Gist options
  • Save yaki29/fc9c0eef3758a348552756b25f5e9641 to your computer and use it in GitHub Desktop.
Save yaki29/fc9c0eef3758a348552756b25f5e9641 to your computer and use it in GitHub Desktop.
from kivy.uix.button import Button
from kivy.uix.pagelayout import PageLayout
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.stencilview import StencilView
from kivy.lang import Builder
from kivy.uix.scrollview import ScrollView
from kivy.app import App
from kivy.animation import Animation
from kivy.animation import AnimationTransition
from kivy.uix.label import Label
Builder.load_string(
'''
<TransitionWidget>:
border: '0dp'
page: 1
Button:
id: 'head'
text: "hello"
BoxLayout:
ScrollView:
bar_color: 1, 0 , 0, 1
bar_width: 4
Label:
text: 'my name is Yash '*100
font_size: 50
text_size: self.width, None
size_hint_y: None
height: self.texture_size[1]
# on_scroll_start: root.anime()
AnchorLayout:
size: self.parent.size
pos: self.parent.pos
anchor_x: 'right'
anchor_y: 'top'
Button:
id: cross
size_hint: None, None
height: '60dp'
width: '60dp'
on_press: root.page = 0
background_color: 0, 0.99, 0.59, 1
''')
class TransitionWidget(PageLayout):
def anime(self):
print "hello yash"
class ScreenApp(App):
def build(self):
return TransitionWidget()
ScreenApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment