Dynamic Image Dimensions based on label
#1
Is it possible for the width of an image to be set based on the width of another control like a label? Here's an example of what I'm trying to achieve.

Image

Now the plan is to make the two ends and middle sections seperate images. That way the rounded ends won't distort and just the middle becomes stretched/squashed based on the labels. Could someone please tell me if what I want to achieve is possible and if so how?
Reply
#2
use a button control?

no need for separate images, you can use the 'border' tag to avoid distortion.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Yeah, but I guess what he wants is something like <width min="10" max="100>auto<width> for buttons and images.
As far as I know it only works for labels at the moment.
Image
Reply
#4
Thanks guys for replying. I'm still new to all this XBMC skinning stuff, but yes I think toolpunk's got the right idea. The text is a label with the image underneath. I don't have control over the content of the label hence the plan to stretch and squash the middle of the image.

I could use borders, but I create all images at 1080 but the code is 720 so borders does strange things I've found when moving between resolutions so if possible I'd like to avoid using them.

So sorry to sound stupid but are we saying its not going to be possible?
Reply
#5
Or what about specifity a color for the background of the label control? That way I just have to add the two images, one at each end. Is that possible?
Reply
#6
CloudDweller Wrote:I could use borders, but I create all images at 1080 but the code is 720 so borders does strange things I've found when moving between resolutions so if possible I'd like to avoid using them.

Your texture's dimensions will need to be divisible by 3 (and therefore your code dimensions divisible by 2) so there's no weird scaling issues.
Reply
#7
All my images are divisible by three so fingers crossed I won't see any issues. However I'm still not sure how to achieve what I want. Can someone please point me in the right direction. Or in other words tell me what to do Wink
Reply
#8
Dynamically sized textures aren't possible yet.
Reply
#9
Sad Okay thanks for confirming.
Reply
#10
Sorry to resurrect an old thread but I don't suppose that this has been implemented yet? If not could I please put in another request? Would be great to see it included.
Reply
#11
No, the autowidth stuff has not yet been implemented for buttons.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Dynamic Image Dimensions based on label0