Using skin expressions to change control location and size based on skin width?

Discussion in 'MediaPortal 1 Skins' started by 2BitSculptor, October 28, 2015.

  1. 2BitSculptor
    • Team MediaPortal

    2BitSculptor Super Moderator

    Joined:
    January 23, 2008
    Messages:
    1,822
    Likes Received:
    290
    Occupation:
    Sculptor - Maquettes, Resin Figure Model Kits, Toy
    Location:
    South Central Wisconsin
    Ratings:
    +386 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I'm making some mods to aMPed to expand the screen to 1920x1080 from 1280x720. I would like to use the current aMPed config without modification. Most of the width/posX related values in the controls are adjusted by styles in the reference.xml, while the height/posY related values are based on a 720 high screen.



    I would like to evaluate the skin width as a condition to use either a multiplier of 1 or a multiplier of 1.5 for the base height/posY related value, eg., if the screen width is 1920 then posY = x*1.5, else posY = x*1.

    I think this would be better than duplicating all relevant controls, in every effected xml, changing the values and adding visibility conditions. It should only take a find function in the xml editor to replace current values.Then all I would need would be to add a new \Font Sizes\HD\ folder for revised fonts.xml and revised references.xml.

    I'm having difficulty wrapping my head around the expression needed. I would appreciate any help (ie... example expression)

    Thanks!

    Chuck
     
    Last edited: October 29, 2015
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,193
    Likes Received:
    4,944
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,341 / 38
    Home Country:
    Germany Germany
    Show System Specs
    Hi Chuck, that´s one of the things not possible with MP - you can´t add a different font.xml in a theme (of course you can, but that will lead to severe problems up to a crash of MP, because the font cache is only written once during start of MP) ;)
    The only solution would be to add ALL the required fonts in the standard fonts.xml and then use skin expressions to display the correct font like
    <font>#(iif(eq(#skin.resolution,'1920'),'font14','font12'))</font> :)
    And now the bad news: AFAIK the <font> property does not allow skin expressions :cry:
     
  4. 2BitSculptor
    • Team MediaPortal

    2BitSculptor Super Moderator

    Joined:
    January 23, 2008
    Messages:
    1,822
    Likes Received:
    290
    Occupation:
    Sculptor - Maquettes, Resin Figure Model Kits, Toy
    Location:
    South Central Wisconsin
    Ratings:
    +386 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Actually, it is not a theme. Dadeo uses the Font Sizes folder to load the fonts.xml and references.xml for each screen size based on the aMPed config values, .... 4x3, 16x9, True4x3 ... and HD if I add it... He also has a Layouts folder for different layouts of Basic Home, Lists, MyVideoShares, and TV Guide based on the pre- and user defined layouts selected in aMPed config ... pretty smart stuff ....

    He uses the Themes folder to select the different color schemes for the skin.
     
    Last edited: October 28, 2015
  5. 2BitSculptor
    • Team MediaPortal

    2BitSculptor Super Moderator

    Joined:
    January 23, 2008
    Messages:
    1,822
    Likes Received:
    290
    Occupation:
    Sculptor - Maquettes, Resin Figure Model Kits, Toy
    Location:
    South Central Wisconsin
    Ratings:
    +386 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I changed the first post to better define the Font Sizes folder
     
  6. 2BitSculptor
    • Team MediaPortal

    2BitSculptor Super Moderator

    Joined:
    January 23, 2008
    Messages:
    1,822
    Likes Received:
    290
    Occupation:
    Sculptor - Maquettes, Resin Figure Model Kits, Toy
    Location:
    South Central Wisconsin
    Ratings:
    +386 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Each time the aMPed Config is used, and an entry is changed/saved, then the cache is deleted, and rebuilt on restart.
     
  7. 2BitSculptor
    • Team MediaPortal

    2BitSculptor Super Moderator

    Joined:
    January 23, 2008
    Messages:
    1,822
    Likes Received:
    290
    Occupation:
    Sculptor - Maquettes, Resin Figure Model Kits, Toy
    Location:
    South Central Wisconsin
    Ratings:
    +386 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    ... so I may be looking at something like this if the aMPed screensize is HD (1920x1080) from the SkinSettings.xml then the posY=1500, if not then posY=1000

    <posY>#(iif(eq(#amped.screensize,"HD"),1500,1000))</posY>

    ... or the texture height of a control if HD then height=1500 else height=1000:

    <height>#(iif(eq(#amped.screensize,"HD"),1500,1000))</height>

    ... or in a zoom animation if HD then center=1882,1097 else center=1255,730:

    <center>#(iif(eq(#amped.screensize,"HD"),1882,1255)),#(iif(eq(#amped.screensize,"HD"),1097,730))</center>

    yes? no?
     
    • Thank You! Thank You! x 1
  8. catavolt
    • Team MediaPortal
    • Administrator

    catavolt Design Group Manager

    Joined:
    August 13, 2007
    Messages:
    12,193
    Likes Received:
    4,944
    Gender:
    Male
    Occupation:
    Technical Documentation, Translation
    Location:
    Lanzarote
    Ratings:
    +7,341 / 38
    Home Country:
    Germany Germany
    Show System Specs
    Yup ;)
     
    • Thank You! Thank You! x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!