Kodi Community Forum
Do variables work with image width & height? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Do variables work with image width & height? (/showthread.php?tid=147046)



Do variables work with image width & height? - buges - 2012-12-03

Can't get this to work at all.

Code:
            <control type="image">
            <posx>500</posx>
            <posy>100</posy>
            <width>$VAR[MyTest1]</width>
            <height>$VAR[MyTest2]</height>
            <texture>somejpg.jpg</texture>
            </control>

The variables are working (tested using a label), But not for images.
Anyone using variables for width & height? if so what am i doing wrong?

Thanks


RE: Do variables work with image width & height? - phil65 - 2012-12-03

(2012-12-03, 19:17)buges Wrote: Can't get this to work at all.

Code:
            <control type="image">
            <posx>500</posx>
            <posy>100</posy>
            <width>$VAR[MyTest1]</width>
            <height>$VAR[MyTest2]</height>
            <texture>somejpg.jpg</texture>
            </control>

The variables are working (tested using a label), But not for images.
Anyone using variables for width & height? if so what am i doing wrong?

Thanks

not possible, vars donĀ“t work for height/width.
you have to define a seperate control for each case.



RE: Do variables work with image width & height? - buges - 2012-12-03

Conditional Includes it is then.

Thanks phil65


RE: Do variables work with image width & height? - Sranshaft - 2012-12-04

Pieh has said before that he'll eventually add in $VAR for numerals once he's able to get auto-sizing controls out of the way. Be aware though that <includes> will work but you'll run into problems. IIRC include conditions are only evaluated on loading the xml. So if, for example, you're using includes in ViewList for a list control to determine the width of the control, you'll need to refresh the skin in order for the new include to take effect.


RE: Do variables work with image width & height? - MassIV - 2012-12-04

Or perhaps a zoom animation (not sure what you want to do exactly):
Code:
<animation reversible="false" effect="zoom" start="10,16,100,200" end="10,16,100,600" time="200">focus</animation>
<animation reversible="false" effect="zoom" end="10,16,100,200" start="10,16,100,600" time="200">unfocus</animation>
That would be "x,y,w,h". Will require that you set an initial width, height, x and y on the image.
For a more complete example have a look at the focused item in fanart view in Confluence. And make them conditional.

Btw, a VAR in aspectratio would also be very welcome.


RE: Do variables work with image width & height? - Sranshaft - 2012-12-04

(2012-12-04, 01:31)MassIV Wrote: Or perhaps a zoom animation (not sure what you want to do exactly):
Code:
<animation reversible="false" effect="zoom" start="10,16,100,200" end="10,16,100,600" time="200">focus</animation>
<animation reversible="false" effect="zoom" end="10,16,100,200" start="10,16,100,600" time="200">unfocus</animation>
That would be "x,y,w,h". Will require that you set an initial width, height, x and y on the image.
For a more complete example have a look at the focused item in fanart view in Confluence. And make them conditional.

Btw, a VAR in aspectratio would also be very welcome.

While that would work for the image, the text will still need to be adjust for width. Adding the zoom animation to the text control will stretch the text leading to narrower / wider text instead of less / more text based on width.




RE: Do variables work with image width & height? - buges - 2012-12-04

Thanks for the info.


RE: Do variables work with image width & height? - janvermeer - 2012-12-05

Thnx, i needed this info aswell