Skip to content

Instantly share code, notes, and snippets.

@inclement
Created June 20, 2015 21:45
Show Gist options
  • Select an option

  • Save inclement/aabd2cd662b2a9b9a61d to your computer and use it in GitHub Desktop.

Select an option

Save inclement/aabd2cd662b2a9b9a61d to your computer and use it in GitHub Desktop.
Color:
rgb: 0.3, 0.3, 0.3 from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
from kivy.base import runTouchApp
class Node(Widget):
pass
class Board(BoxLayout):
node1_pos = ListProperty([5, 5])
root = Builder.load_string('''
<Node>:
orientation: 'vertical'
size: 200, 200
canvas:
Color:
rgb: 0.3, 0.3, 0.3
Rectangle:
pos: self.pos
size: self.size
<Board>:
node1_pos: node1.pos
canvas.after:
Color:
rgba: 1, 0, 0, 1
Line:
points: root.node1_pos[0],root.node1_pos[1],100,100
Node:
id: node1
Widget:
Node:
id: node2
Board:
''')
runTouchApp(root)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment