Using skin expressions to change control location and size based on skin width? (1 Viewer)

2BitSculptor

Super Moderator
  • Team MediaPortal
  • January 23, 2008
    1,948
    498
    South Central Wisconsin
    Home Country
    United States of America United States of America
    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:

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,363
    10,399
    Königstein (Taunus)
    Home Country
    Germany Germany
    Then all I would need would be to add a new \fonts\HD\
    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:
     

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    1,948
    498
    South Central Wisconsin
    Home Country
    United States of America United States of America
    • Thread starter
    • Moderator
    • #3
    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:

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    1,948
    498
    South Central Wisconsin
    Home Country
    United States of America United States of America
    • Thread starter
    • Moderator
    • #6
    ... 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?
     

    Users who are viewing this thread

    Top Bottom