kivy-gamecamp-pong-tutorial/pong.kv

34 lines
636 B
Plaintext
Raw Normal View History

2016-06-03 15:14:05 -04:00
#:kivy 1.0.9
<PongGame>:
# This needs to be up top, otherwise the properties are not defined.
ball: pong_ball
canvas:
Rectangle:
pos: self.center_x - 5, 0
size: 10, self.height
Label:
font_size: 70
center_x: root.width / 4
top: root.top - 50
text: "0"
Label:
font_size: 70
center_x: root.width * 3 / 4
top: root.top - 50
text: "0"
PongBall:
id: pong_ball
center: self.parent.center
<PongBall>:
size: 50, 50
canvas:
Ellipse:
pos: self.pos
size: self.size