Kodi Community Forum

Full Version: Coordinates & origin. Why?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Could someone please explain what the benefits of using coordinates and why they are used for dialogs and not other windows?

<coordinates>
<system>1</system>
<posx>0</posx>
<posy>0</posy>
<origin x="490" y="160" />
</coordinates>

I’ve read the skinning manual but I can’t see why they are used, as opposed to simply specifying the x/y of each control. Also what’s <system>1</system> and <origin/> used for as I’ve not been able to find this info anywhere, but many skins use them?
coordinates

This block is used to specify how XBMC should compute the coordinates of all controls.

origin

Sets a conditional origin for the window. The window will display at (x,y) whenever the origin condition is met. You can have as many origin tags as you like – they are evaluated in the order present in the file, and the first one for which the condition is met wins. If none of the origin conditions are met, we fall back to the <posx> and <posy> tags.

And <system> has been removed -

http://forum.xbmc.org/showthread.php?tid=93716
Great thanks Hitcher. So is there an advantage using coordinates compared to just specifying the position of each control or is it just a case that if you want to move a dialog and all its controls to the left, you simply change one value as opposed to changing each and every control?

And if I simply want to centre a window on both the X and Y, am I best to use coordinates?
If all you want to do is center a window, then just define the appropriate x and y coordinates in the <origin> tag.
As hitcher says Origin can be used to move them around if other windows and things are active like in pm3.hd I have this for DialogMusicScan
PHP Code:
<coordinates>
    <
posx>850</posx>
    <
posy>10</posy>
    <
origin x="30" y="10">Window.IsVisible(seekbar)</origin>
</
coordinates
which means that if the seekbar is visible it appears at x=30 instead of overlapping it at x=850
Thanks you for all your help. That clears things up.