Created
June 20, 2015 21:45
-
-
Save inclement/aabd2cd662b2a9b9a61d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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