Use Label to display characters in Kivy. If you want to move it to the upper left, write it like below.
test.kv
Label:
text: root.text
halign: 'left'
valign: 'top'
Actually, this doesn't move to the upper left. It is displayed in the center. Label has a property called text_size that determines the display area in addition to size. halign and valign are properties that determine the position in text_size.
If text_size remains small, no matter which one you approach within text_size The text_size itself is displayed in the center After all, the characters are displayed in the middle.
If you specify text_size: self.size
as shown below, the entire Label area will be displayed.
It becomes the display area of characters.
The characters will be displayed in the upper left because they will be moved to the upper left.
Label:
text_size: self.size #← Add
text: root.text
halign: 'left'
valign: 'top'
Recommended Posts