Kodi Community Forum

Full Version: Skin resolution / rendering
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was looking at an issue in my skin where it wasn't rendering to fill the whole window with Kodi set to windowed and arbitrary window dimensions on the desktop.

I have a single folder for skin xml files and the design dimensions are 1920x1080/16:9

What I found is that if I have just a single res element in my addon.xml:
xml:
<res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
then the skin always renders correctly, even if the window dimension is 1000x1000.
But if I add another resolution for 4:3, pointing to the same folder:
xml:
<res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
<res width="1920" height="1440" aspect="4:3" default="false" folder="xml" />
then Kodi finds the 4:3 as the closest resolution, but when the skin is rendered it is rendered at 16:9 aspect, with the remainder of the window "black".  That's true even if I switch to full screen (windowed):  the 1000x1000 window is just stretched with the skin rendered still in the upper portion until a restart.

But if I do the same thing with Estuary, this doesn't happen.  It always renders in the whole window.  I can't for the life of me see what Estuary does different.

scott s.
.
The following is my understanding, so take it with a grain of salt.

The resolution elements of the XML are more important for you than for the actual GUI rendering. It defines a grid for the absolute placement/size of GUI elements (textures, groups, ... everything).

When designing a skin, special care has to be put in when choosing relative or absolute size/position values. Otherwise, it will show issues when different grid resolutions are used. Sometimes this is not possible (space wise), so different versions for various aspect ratios have to be made.

In the end, you can think of it as placing all elements on relative positions, with the resolution grid converting absolute to relative values. Let's say you want to place a fanart, covering the whole screen. Pretty easy with relative values, just set it to [100%,100%]. Setting it absolute (on a 1920x1080 grid) would be [1920,1080]. Converted to relative sizes, it would be [1920/1920,1080/1080], or [100%,100%]. But when changing the grid to 1920x1440, it will go wrong: [1920/1920,1080/1440], or [100%,75%].

As for the aspect change when scaling Kodi in windowed mode, I suspect that it would need a reinit of the GUI rendering part. But given that Kodi is an application intended to run full screen all the time, this is not really an issue (in my eyes).
(2022-11-11, 09:00)sarbes Wrote: [ -> ]The following is my understanding, so take it with a grain of salt.

The resolution elements of the XML are more important for you than for the actual GUI rendering. It defines a grid for the absolute placement/size of GUI elements (textures, groups, ... everything).

When designing a skin, special care has to be put in when choosing relative or absolute size/position values. Otherwise, it will show issues when different grid resolutions are used. Sometimes this is not possible (space wise), so different versions for various aspect ratios have to be made.

In the end, you can think of it as placing all elements on relative positions, with the resolution grid converting absolute to relative values. Let's say you want to place a fanart, covering the whole screen. Pretty easy with relative values, just set it to [100%,100%]. Setting it absolute (on a 1920x1080 grid) would be [1920,1080]. Converted to relative sizes, it would be [1920/1920,1080/1080], or [100%,100%]. But when changing the grid to 1920x1440, it will go wrong: [1920/1920,1080/1440], or [100%,75%].
Converting an existing skin would seem like a major problem

(2022-11-11, 09:00)sarbes Wrote: [ -> ]As for the aspect change when scaling Kodi in windowed mode, I suspect that it would need a reinit of the GUI rendering part. But given that Kodi is an application intended to run full screen all the time, this is not really an issue (in my eyes).
I tried a couple things like creating a second folder for 4:3 aspect, in case using the "default" folder did something different. I agree it isn't a real problem, I only use windowed mode for testing and development otherwise I have to alt-tab in windows a lot.

scott s.
.