Programmer help please to move all PosX/Y ? (1 Viewer)

2BitSculptor

Super Moderator
  • Team MediaPortal
  • January 23, 2008
    2,007
    1,052
    South Central Wisconsin
    Home Country
    United States of America United States of America
    I'm looking to adapt Blue3 (or other 4x3 skins) to an 800x600 display without stretching. I would just like to move all the PosX, PosY instances (including spinPosX and spinPosY) an additional 40 pixels to the right and an additional 12 pixels down. Is it possible someone can make a batch utility to open each xml and replace all PosX/PosY values with the new position value. That way, any OSDs or Dialogs that need to be centered on the screen, will be, and other screens will allow for overscan issues by giving them additional border space.

    This will greatly facilitate the design of new skins for true 800x600 display.

    Thanks immensely.

    Chuck
     

    citizenkeys

    Portal Pro
    May 17, 2009
    187
    16
    Home Country
    United States of America United States of America
    It's not quite that simple.
    Because when you change the skin resolution size, you have more space on the screen.
    so the space between certain elements, like labels or graphics, needs to be completely reconsidered.
     

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    2,007
    1,052
    South Central Wisconsin
    Home Country
    United States of America United States of America
    • Thread starter
    • Moderator
    • #3
    The relative 'recentering' of all the current xmls is a starting point for that re-evaluation of design.

    I've been working on an 800x600 skin for some time. There are many OSDs/dialogs that I do not have occassion to see. Centering those on the screen, blindly, one element at a time is most tedious, and increasingly open to the problem of an older brain ;) (misalignments)

    With the traditional 10% overscan allowance on an 800x600 layout, your usable space is similar enough to the original PAL dimmensions. ... 720x540 (compared to the original 720x576). The OSDs and some dialogs fit well inside that allowance and would require little or no adjustment. Only the full display screens (ie, the main skin xmls and plugin xmls) would need adjusment to their layout from that point. I don't have plans to redesign the layouts of the OSDs/dialogs (except for the info dialogs for music, videos, and pictures); they can stay as they are, just need to be centered on the larger screen.

    regards,

    Chuck
     

    citizenkeys

    Portal Pro
    May 17, 2009
    187
    16
    Home Country
    United States of America United States of America

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    2,007
    1,052
    South Central Wisconsin
    Home Country
    United States of America United States of America
    • Thread starter
    • Moderator
    • #5
    MPII is not a present solution. MPI still has at least another year of viablility and may be used by some for a time after that.

    I've been using the 800x600 skin that I have under dev for several months. It is not ready to distribute, as most of the dialogs and OSDs that I spoke of are still off-center. You can see my design in another thread, although I haven't updated the images yet to show the overscan allowance that I added. I personally don't like having to push all the elements together because of the overscan issue, but using smaller fonts is not an option.

    Regards,

    Chuck
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,643
    775
    Göteborg
    Home Country
    Sweden Sweden
    I've made a script that replaces text in all xml files in the same folder. I can modify it to search for posx/posy and change the numbers if you'd like.

    Just to clarify, you wish to add 40 to ALL PosX/spinPosX and 12 to ALL PosY/spinPosY?

    For example
    Code:
    <PosX>100</PosX>
    <PosY>100</PosY>
    <spinPosX>200</spinPosX>
    <spinPosY>200</spinPosY>
    would be changed to:
    Code:
    <PosX>140</PosX>
    <PosY>112</PosY>
    <spinPosX>240</spinPosX>
    <spinPosY>212</spinPosY>
    Correct?
     

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    2,007
    1,052
    South Central Wisconsin
    Home Country
    United States of America United States of America
    • Thread starter
    • Moderator
    • #7
    I've made a script that replaces text in all xml files in the same folder. I can modify it to search for posx/posy and change the numbers if you'd like.

    Just to clarify, you wish to add 40 to ALL PosX/spinPosX and 12 to ALL PosY/spinPosY?

    Yes, exactly. That would be wonderful!

    I can correct any background back to 0,0 manually (much easier to find :) since I need to change the 720x576 images to 800x600 anyway.

    :D:D:D

    best regards,

    Chuck
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,643
    775
    Göteborg
    Home Country
    Sweden Sweden
    Here's the file.

    It'll open all .xml files in its own directory and subdirectories and overwrite the files after the search and add is done. You probably want to do it in a temporary copy folder, just in case :)

    The script is somewhat configurable. Here's what the current search/add looks like:
    Code:
    Dim rxSearch(3, 1) ' First value sets number of searches (zero-based)
    rxSearch(0, 0) = "<posX>(\d+)</posX>"
    rxSearch(0, 1) = 40
    rxSearch(1, 0) = "<posY>(\d+)</posY>"
    rxSearch(1, 1) = 12
    rxSearch(2, 0) = "<spinPosX>(\d+)</spinPosX>"
    rxSearch(2, 1) = 40
    rxSearch(3, 0) = "<spinPosY>(\d+)</spinPosY>"
    rxSearch(3, 1) = 12
    If you, for example, like to change it to add 100 to all height tags, modify it to:
    Code:
    Dim rxSearch([B]0[/B], 1) ' First value sets number of searches (zero-based)
    rxSearch(0, 0) = "<height>(\d+)</height>"
    rxSearch(0, 1) = 100

    I couldn't find any <spinPosX> in the Blue3 skin but I've verified that it works correctly on <PosX> and <PosY>.
    Have fun :)
     

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    2,007
    1,052
    South Central Wisconsin
    Home Country
    United States of America United States of America
    • Thread starter
    • Moderator
    • #9
    Thanks, will try it now.

    spinPosX and spinPosY are generally found, first, in the references.xml, then in several dialogs and textboxes in various others, also in tvguide.xml, I believe.

    :D again

    Chuck

    edit:

    Just viewed the Blue3 skin after applying the script..... All I can say is "WONDERFUL!"

    There were only a small number of instances that the value seems to have been applied twice, mostly in the posX (I noticed only once in the PosY) and only a couple where the value was missed, but I think I can find them easily. All the spinPos values seemed to be applied correctly.

    I can see this also being a great help in setting up wide screen skins to more native resolutions.

    Chuck
     

    vuego

    Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,643
    775
    Göteborg
    Home Country
    Sweden Sweden
    Ahh sorry I see what happened there. If there's both lets say <posX>60</posX> and <posX>100</posX> in the same file, my loop would first change 60 to 100 and then both 100 to 140 :oops:

    I've changed it to read line by line instead.

    If you have an example of where the value was missed I could try to figure out why.
     

    Attachments

    • MassSearchAddReplaceV2.zip
      30.7 KB

    Users who are viewing this thread

    Top Bottom