#tutorial.kv
#:import random random
<ScatterTextWidget>:
orientation: 'vertical'
canvas.before:
Color:
rgba: 0, 0, 1, 1
Rectangle:
pos: 0, 100
size: 300, 100
Ellipse:
pos: 0, 400
size: 300, 100
Line:
points: 0, 0, 500, 600, 400, 300
close: True
width: 3
TextInput:
id: textinput_id
font_size: 150
size_hint_y: None
height: 200
text: 'default'
on_text: root.change_label_colour()
#on_text: label_id.color = [random.random() for i in [0,1,2]] + [1]
FloatLayout:
Scatter:
Label:
id: label_id
text: textinput_id.text
font_size: 150
color: root.text_colour
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: 150
Label:
id: label1
text: textinput_id.text[:3]
font_size: 100
color: root.text_colour
Label:
id: label2
text: textinput_id.text[-3:]
font_size: 100
color: root.text_colour
reference:
No comments:
Post a Comment