Kodi Community Forum

Full Version: VideoOSD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have this code in VideoOSD :

Code:
<control type="slider" id="87" description="Seek Slider">
    <posx>100</posx>
    <posy>40</posy>
    <width>1070</width>
    <height>24</height>
    <onup>-</onup>
    <ondown>-</ondown>
    <action>seek</action>
    <texturesliderbar border="14,0,14,0">OSD/OSDProgressBack.png</texturesliderbar>
    <textureslidernib border="8">OSD/SeekNibNF.png</textureslidernib>
    <textureslidernibfocus border="8">OSD/SeekNibFO.png</textureslidernibfocus>
    </control>

but I'm unable to make a NIB (24x24px) keep aspect ratio. It always gets stretched. What am I missing?
Tried border="12" ?
Hitcher Wrote:Tried border="12" ?

Just tried it. It still makes bar out of nib.
Its a bug basically you can't because the size of the nib is calculated by the size of the slider background so what you need to do is fart around wih OSD/OSDProgressBack.png and inscrease its dimensions (width mostly) like I had too with confluence Sad
I'm happy to change things around if there's a better idea - remember that most controls scale to their defined rect size, so atm we basically assume that all textures should scale by the same amount that the background does.
Jezz_X Wrote:Its a bug basically you can't because the size of the nib is calculated by the size of the slider background so what you need to do is fart around wih OSD/OSDProgressBack.png and inscrease its dimensions (width mostly) like I had too with confluence Sad

Thanks, I wondered how you did it. I'll take a peek.
jmarshall Wrote:I'm happy to change things around if there's a better idea - remember that most controls scale to their defined rect size, so atm we basically assume that all textures should scale by the same amount that the background does.

I'm little confused. NIB seams to work just fine in scrollbars, which led me to think that NIB is an image that has aspectratio=keep hardwired.
I agree that the Slider Nib should not be scaled with the background when it comes to the OSDs. They are after all indicating a specific, single point in the progress of whatever's playing.
@ pecinko

You could try padding it with empty space on the right of the image and then set the border to cover the part you don't want scaled.
Which bit is scaled? Is it scaled with height and width or with both? As I say, am happy to change it to not scale at all, or only scale in one dimension and keep aspect otherwise etc.

Just let me know a recipe that'll work for you all and I'll apply it Smile

Cheers,
Jonathan
I'd go for height scaling so the maths works like this

image are background = 16 pixels high, nib = 32 pixels high

in skin background gets sized to 8 pixels high then nib gets sized to 16 pixels high and keeps its aspect and is aligned with the slider in the center of the nib not the start of it
https://github.com/jmarshallnz/xbmc/tree...spect_keep

That should do what you want I think?
jmarshall Wrote:That should do what you want I think?

I cannot build, but if it behaves as in Jezz_X's explanation - that's the way.