home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Skins
Skin XML Calculator...
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="TesterBoy" data-source="post: 82485" data-attributes="member: 22382"><p>In an effort to improve the lot of Skinners around the world, I've built an expression parser to help reduce the effort required to maintain both 4x3 and WS versions of a skin. It's currently fairly basic, only allowing numeric calculation (no strings), but I wanted to find out if there's any interest and/or point in taking it further.</p><p></p><p>It builds on the exiting <define> tag and '#' syntax as follows:</p><p></p><p>Say you have a skin element tag such as <posx> - you can use the following:</p><p></p><p>1. Absolute position (current functionality): <posx>120</posx></p><p></p><p>2. Specified by a constant (current):</p><p></p><p> <define>#MyPosX:120</define></p><p> ...</p><p> <posx>#MyPosX</posx></p><p></p><p>3. Absolute offset from right-hand side (120 pixels from the right edge):</p><p></p><p> <posx>#(#ScreenWidth - 120)</posx></p><p></p><p>Sorry - forgot to mention that #ScreenHeight and #ScreenWidth are built-in and taken automatically from GUIGraphicContext.SkinSize</p><p></p><p>4. (10) Percent of the screen width:</p><p></p><p> <posx>#(#ScreenWidth*10/100)</posx></p><p></p><p>5. You can use defines to create subexpressions:</p><p></p><p> <define>#TenPercentofWidth: (#ScreenWidth*10/100)</define></p><p> ...</p><p> <posx>#TenPercentofWidth</posx></p><p></p><p>6. and use them in more complex expressions:</p><p></p><p> <posx>#(#TenPercentofWidth*3/2)</posx> (15% of width (I think!))</p><p></p><p></p><p>7. String expressions - e.g. you can calculate the name of a graphic </p><p></p><p> #('myHome' + #ScreenWidth + 'x' + #ScreenHeight + '.png') -- myHome1280x720.png</p><p></p><p>or maybe </p><p></p><p> #(#ScreenWidth + 'x' + #ScreenHeight + '\myHome' + '.png') -- 1280x720\myHome.png</p><p></p><p>if you want to put gfx for different sizes/aspect ratios in separate directories.</p><p></p><p>I need to define some built-in functions (e.g. if(,,) would possibly be useful), and also it currently does integral arithmetic, so floats would be an obvious extension.</p><p></p><p> That's enough from me. The questions are</p><p></p><p>1. Is this going to be useful</p><p></p><p>2. Would anybody use it</p><p></p><p>and therefore,</p><p></p><p>3. Should I continue working on it, or find something else to play with? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>Note that it doesn't (seem to) break any existing skin syntax, but making sure it didn't has made some of the syntax (e.g. "#(...)" a bit clumsy... (Anyway, that's my excuse, and I'm sticking to it...)</p></blockquote><p></p>
[QUOTE="TesterBoy, post: 82485, member: 22382"] In an effort to improve the lot of Skinners around the world, I've built an expression parser to help reduce the effort required to maintain both 4x3 and WS versions of a skin. It's currently fairly basic, only allowing numeric calculation (no strings), but I wanted to find out if there's any interest and/or point in taking it further. It builds on the exiting <define> tag and '#' syntax as follows: Say you have a skin element tag such as <posx> - you can use the following: 1. Absolute position (current functionality): <posx>120</posx> 2. Specified by a constant (current): <define>#MyPosX:120</define> ... <posx>#MyPosX</posx> 3. Absolute offset from right-hand side (120 pixels from the right edge): <posx>#(#ScreenWidth - 120)</posx> Sorry - forgot to mention that #ScreenHeight and #ScreenWidth are built-in and taken automatically from GUIGraphicContext.SkinSize 4. (10) Percent of the screen width: <posx>#(#ScreenWidth*10/100)</posx> 5. You can use defines to create subexpressions: <define>#TenPercentofWidth: (#ScreenWidth*10/100)</define> ... <posx>#TenPercentofWidth</posx> 6. and use them in more complex expressions: <posx>#(#TenPercentofWidth*3/2)</posx> (15% of width (I think!)) 7. String expressions - e.g. you can calculate the name of a graphic #('myHome' + #ScreenWidth + 'x' + #ScreenHeight + '.png') -- myHome1280x720.png or maybe #(#ScreenWidth + 'x' + #ScreenHeight + '\myHome' + '.png') -- 1280x720\myHome.png if you want to put gfx for different sizes/aspect ratios in separate directories. I need to define some built-in functions (e.g. if(,,) would possibly be useful), and also it currently does integral arithmetic, so floats would be an obvious extension. That's enough from me. The questions are 1. Is this going to be useful 2. Would anybody use it and therefore, 3. Should I continue working on it, or find something else to play with? :) Note that it doesn't (seem to) break any existing skin syntax, but making sure it didn't has made some of the syntax (e.g. "#(...)" a bit clumsy... (Anyway, that's my excuse, and I'm sticking to it...) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Skins
Skin XML Calculator...
Contact us
RSS
Top
Bottom