Image size based off label string size ?
#1
Hello all,

I was just wandering if there is any way to automatically change the size of an image based off the size of the text string on a label ?

I have a background overlay behind my label and a script that will grab text from the internet, i was wandering if there is a way to make the background overlay automatically fit the size of the text. Like on the Xbox One, it has a little black overlay behind the text that will change its size to fit the label width.

Thanks.
Reply
#2
there is no way to get the width of a label control at the moment.
the only hack I can imagine is to count the amount of chars and then use ControlImage.setAnimations or ControlImage.setWidth in Python. Since most skin fonts are not monospaced it will be far from perfect though.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply

Logout Mark Read Team Forum Stats Members Help
Image size based off label string size ?0