Change Background Color And Text Color of Labels - Python Kivy GUI Tutorial #10

preview_player
Показать описание
In this video I'll show you how to change the background and text color of Labels with Kivy and Python.

Changing the background color and text color of a Kivy Label is a little more complicated than changing the color of other widgets. We need to set a Canvas and create a rectangle first.

We'll also look at making text bold and italic, as well as giving it a shadow background!
Рекомендации по теме
Комментарии
Автор

On (what I thought was) a completely different topic... I was trying to get a label to show over top of a background image. It turns out that the only way to do that is to define a canvas.before for the Label and give it a Color and Rectangle.

Every language has its weirdness(es) and this is definitely one for the books.

Thanks again, John. Learning lots.

rontarrant
Автор

▶️ Watch Entire Kivy Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

quick question how did you make the .kv file colorfull (looks like actual code)? unlike past videos were it was just white. thank you

sin-ohxi
Автор

Hola John, escribo desde Argentina! te felicito por el canal, eres un excelente educador. Tus videos me están ayudando mucho. Muchas Gracias!

facundorodriguez
Автор

Hey, pretty cool video again! A few notes - I didn't even know you could mix canvas instructions in the middle like that, and while it's nice, it's more conventional to have your rules be ordered like properties → canvas → children. You added syntax HL, nice! Didn't realize it until it failed on the outline properties for some reason, but it sure makes the code easier to follow! And finally, there's a few more things about colors - first you can use implicit tuples (for colors and size and any tuple), so you can just remove the brackets ; also (and I know it might be overkill in the tutorial), you could use a list comprehension to handle the /255 for you, like "color: [rgba/255 for rgba in (192, 168, 0, 255)]" or something :-)

cheaterman
Автор

Hello John
Can you explain to me how to create an automatic line inside the label when it is larger than the screen border

nadermohamad
Автор

Awesome as always!
Please can you tell us what have you done or what package have you installed in order for kv autocomplete to work?

whitebird
Автор

Thanks for you I love style for teaching please Keep it up

alaahoussen
Автор

Its me again, sir your videos are cool enough for changing summer to winter
But is it neccessary to use outline_width for changing the text outline color?

suchetmahamuni
Автор

I really love your style of teaching, Thank you, sir!
just needed help on how can I increase my speed of typing the code because I type really slow and I have to stop the video for a long time to complete typing, after so many years of coding maybe like 3 to 4 yrs still I can't type fast, any suggestions sir?

daggercentral
Автор

I try this code with kv design file, but not working, I cant write self.background_color, when executing throw my exception:
AttributeError: 'Label' object has no attribute 'background_color'
What's wrong?

zcsaba
Автор

next video:
create multi screen apps using kivy

msfmapper
Автор

Sir we are in kv file so what is 'self' here

allanimeworld
Автор

Sir can i ask a doubt from kivymd,
if i can, the problem is "how can i change screens with speeddialbuttons "

Sir if it is hard to explain in this chat, so i will wait for kivymd videos :)
becoz i searched a lot before writing this chat 😐

devansh
Автор

Can someone please help me? For some reason, when I use Builder, I get this error message:
Unknown class <MyLayout>

I have also imported Builder

infinitespace
Автор

Am i only only the one who felt this tutorial too difficult :(

prerit
Автор

It's easy indeed, but also horrible. No, way around that. I hope it gets redesigned tbh

randall.chamberlain
welcome to shbcf.ru