Kodi Community Forum

Full Version: Progress control problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Look at this progress:
watch gallery


Where does the border come from and why lefttexture and righttexture are stretched (they are 2 pixel wide images - the white on the ends indicates the stretch, as I have not applied transparency yet)?

The code:

Code:
<control type="progress">
<description>My first progress control</description>
<left>80</left>
<top>60</top>
<height>20</height>
<lefttexture border="0">pb-start.png</lefttexture>
<midtexture border="0">pb.png</midtexture>
<righttexture border="0">pb-end.png</righttexture>
<info>100</info>
<width>500</width>
</control>
Well, the frame disappeared after adding texturebg as a few transparent pixels.I don't know why it works like that.

As for rendering, for a given info value it takes lefttexture with length stretched for the current progress, then midtexture just once, and then righttexture in the same way as lefttexture.
So fe. for System.Memory(used.percent) == 70 and progress control width 100 you get current progress bar of length 140+width of midtexture.

Kodi, srslyHuh

Current code:
Code:
<control type="progress">
<description>My first progress control</description>
<left>70</left>
<top>45</top>
<height>5</height>
<width>500</width>
<texturebg>pb-back.png</texturebg>
<lefttexture>pb-start.png</lefttexture>
<midtexture>pb.png</midtexture>
<righttexture>pb-end.png</righttexture>
<info>System.Memory(used.percent)</info>
</control>
Make sure you size your actual background texture to the size of the progress bar to avoid stretching. I can't remember if you have to size the mid texture to the progress bar also. You might also want to define border="X" in your texture tags, with X being the size of the border from the edge of the texture that you don't want stretched.

Also regarding the default background frame, what does your Defaults.xml look like? You might have a texture predefined for progress controls there (defaults.xml contains the default definition of controls that is used when you don't specify certain elements).
OK, so imo if you want to have lefttexture and righttexture, you HAVE to have texturebg. texturegb needs to be the size of whole progress bar area, otherwise midtexture just don't work. Bounding box set by height/width of a progress control is not enough.

I officially despise the skinning manual - it could serve as a map to treasures of the Templars. They would be safe forever.

And just one issue - for whatever reason righttexture is duplicated

watch gallery


Code:


Code:
<control type="progress">
<description>My first progress control</description>
<left>70</left>
<top>45</top>
<height>5</height>
<width>500</width>
<texturebg>pb-back.png</texturebg>
<lefttexture border="2">pb-start.png</lefttexture>
<midtexture>pb.png</midtexture>
<righttexture border="2">pb-end.png</righttexture>
<info>System.CPUUsage</info></control>