Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from kivy.config import Config
- Config.set('graphics','fullscreen','auto')
- from kivy.uix.label import Label
- from kivy.uix.image import Image
- from kivy.uix.boxlayout import BoxLayout
- from kivy.uix.scatterlayout import ScatterLayout
- from kivy.lang import Builder
- from kivy.base import runTouchApp
- Builder.load_string('''
- <RootLayout>:
- orientation: 'horizontal'
- shipPath: []
- ScatterLayout:
- auto_bring_to_front: False
- Image:
- id: blabla
- size_hint: (1.0,1.0)
- source: "myocean3.png"
- canvas.after:
- Line:
- points: root.shipPath
- BoxLayout:
- size_hint: (0.25, 1.0)
- orientation: 'vertical'
- canvas.before:
- Color:
- rgb: .0, .0, .0
- Rectangle:
- pos: self.pos
- size: self.size
- padding: 20
- spacing: 20
- Button:
- text: 'Ship Route'
- on_press: root.setShipPath()
- Button:
- text: 'button2'
- Button:
- text: 'button3'
- Button:
- text: 'button4'
- ''')
- class RootLayout(BoxLayout):
- shipPath = []
- def setShipPath(self):
- self.shipPath = [100, 100, 200, 300, 400, 600]
- print self.shipPath
- runTouchApp(RootLayout())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement