Another percentage question
#1
In an image control I can't get them to work.

Do percentages only work for labels?

Thanks.
Reply
#2
They should work everywhere - all it does is compute the correct <left>, <right> etc. absolute coordinates on control allocation.
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
#3
So the following code should result in the texture being centrally aligned and half the size of it's parent?

PHP Code:
<control type="group">
    <
left>0</left>
    <
top>0</top>
    <
width>1920</width>
    <
height>1080</height>

    <!-- 
Dialog background image -->
    <
control type="image">
        <
centerleft>50%</centerleft>
        <
centertop>50%</centertop>
        <
width>50%</width>
        <
height>50%</height>
        <
texture border="10">dialogs/DialogBackgroundImage.png</texture>
    </
control>

</
control

Because I end up with the texture in the centre but it's only 50x50px.
Reply
#4
Looks like a bug - it will work if you do <width min="50%" max="50%">auto</width> right?

(Probably your labels were already using this?)
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
#5
That worked for the size but now it's not centered. Confused
Reply
#6
Make sure that <left> and <top> aren't defined in defaults.xml. That's usually the cause.

In the meantime, I'll do up a fix for <width>50%</width>
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
#7
Fixed in master - that'll get backported to Gotham.
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
#8
(2014-04-28, 10:22)jmarshall Wrote: Make sure that <left> and <top> aren't defined in defaults.xml. That's usually the cause.

In the meantime, I'll do up a fix for <width>50%</width>
Not in any of my defaults.
(2014-04-28, 10:39)jmarshall Wrote: Fixed in master - that'll get backported to Gotham.
For the <width>50%</width> problem?

Thanks.

What I'm trying to achieve here is a base skin where only a minimum of changes are needed (default textures, max width and height of a control group) removing the need to recode entire windows/dialogs but at the same time making a skin look totally different. So basically only two dimensions could be defined and everything else would be based on percentages of the main control group.

Should this be possible now?
Reply
#9
Indeed it should be, as long as you want everything to scale the same way.

And yeah, the fix is in for the width/height issue. I could reproduce it fine using Confluence, but my trick above worked OK once I removed the default <left> and <top> from the image control. Reason is that with <left> and <centerleft> both defined, you've nailed down the width as well. Thus, specifying 3 of them gives conflicting information, and one has to give.
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
#10
All working so far using <width min="n%" max="n%">auto</width> as I take it the fix hasn't hit the nightlies yet.

This is what I've achieved by simply changing 2 dimensions and a few textures.

Image

Image

Are there any plans to add all dimensions?

ie layout widths & heights, textwidth, textoffset, etc.

Thanks.
Reply
#11
Neat Smile

Hadn't considered others, but there's no reason we couldn't. The problem I guess is what they reference? Would they always reference the parent size? If so, what is the parent size of the layout - the size of the container or the size of the group the container is in? Once we sort that it'd be pretty easy to hook it up (you'd also get the 50r stuff for free, though I suspect it doesn't make much sense in most cases!)

(And yeah, nightlies are coming from Gotham branch, so won't include it until I backport - will do so this evening).
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
#12
I guess it would be consistent to always use the parent whether it's a container or a group.

Thanks.
Reply
#13
Do you know by any chance if there's news on the use of percentages inside layouts?
Reply
#14
(2014-04-29, 23:05)jmarshall Wrote: Neat Smile

Hadn't considered others, but there's no reason we couldn't. The problem I guess is what they reference? Would they always reference the parent size? If so, what is the parent size of the layout - the size of the container or the size of the group the container is in? Once we sort that it'd be pretty easy to hook it up (you'd also get the 50r stuff for free, though I suspect it doesn't make much sense in most cases!)

(And yeah, nightlies are coming from Gotham branch, so won't include it until I backport - will do so this evening).

@jmarshall

Any update/progress on this please?

Thanks.
Reply
#15
JMarshall > Retired Team-XBMC Developer :-(
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

Logout Mark Read Team Forum Stats Members Help
Another percentage question0