Rockbox Technical Forums
Support and General Use => Theming and Appearance Customization => Topic started by: JdGordon on July 02, 2008, 11:28:08 AM
-
it appears I closed the previous stick too early...
%P %pb and %m have all been changed recently so if your WPS isnt loading its most likely because of that...
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS
(for the lazy)
%P and %m have been removed
%pb is now %pb|bmp|x|y|width|height| or just %pb
use viewports and conditional viewports to replace %m
For crying out loud... yes its the same link above 3 times... I could have made it 4 and I could have made it 1... I purposly chose 3... why? we'll never know, im an enigma.. but its 3, and will remain 3... which also happens to be the same amount of times its been discussed in IRC... what is so special about the number 3?
-
As jswetzen said elsewhere:
The old format was:
%P|filename.bmp|
%pb|height|left-position|right-position|y-position(optional)|
and the new one is:
%pb|filename.bmp|x|y|width|height|
which means that:
x = left-position
y = y-position
width = right-position - left-position
height = height
and the filename is copied from the %P tag.
Please upload your corrected WPSes to the wiki.
pondlife
-
removed the sticky but bumping to keep this on the front page for a little while longer.
Hopefully everyone has got the point by now :p
-
any chance of getting an example for rewriting a %m line in the new syntax?
-
or maybe at least an explanation of what the old %m syntax was?? I can't find it anywhere in the docs.
Boo
-
The CustomWPS wiki page has the new syntax, and you can view older versions of it from the controls at the bottom of the page to get back to the previous syntax.
-
The %m teg was used to define scrolling margins.
Example:
%s%m|25|151| Disaster is coming.
This would display "Disaster is coming." beginning at 25 pixels on the left and cut it off at 151 pixels on the right and then start scrolling. This tag is obsolote because you can do scrolling with viewports now.
To get the same results, you simply have to create a viewport with similar dimensions.
E.g.:
%V|25|10|126|12|-|-|-|
%sDisaster is coming.
126=151-25
The y position of the viewport is arbitrary. You have to try out some values, to see, if the line with the %m tag is on the same level as the viewport.
-
Thanks to both you, VERY much
Boo
-
Thank you.
If anyone is curious, %m Margin Tag is last documented in CutomWPS's revision #107
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS?rev=107#Margin
Now just to beat a dead horse, are the following still in use?
Hold Switches ( %mh, %mr),
Repeat Mode ( %mm ), and
Playback Mode (%mp )
-
None of those were mentioned as changed.
-
Gotcha. I wanted to make sure as those tags do have a %m in them.
( and yes, i understand now that those tags are wholly unrelated to margin tags )
-
The %m teg was used to define scrolling margins.
Example:
%s%m|25|151| Disaster is coming.
[colours changed to stress something.]
Note that this second red number (including the additional "|") was never a valid variable in official Rockbox, the "official" margin tag only let you set a left margin. There was a patch though for specifying a right margin too and it was used in some unsupported builds and themes. So you would have to caclulate with the screen width minus the left margin to get the viewports width if you have a margin tag with only the left margin specified and want to mimic this old behaviour or as maximum width.
-
I believe the viewports were designed to automatically assume the width and height as "LCD width - x-pos" and "LCD height - y-pos" in absence of width and height definitions...
-
True, with absence being a "-" instead of a value. This also applies for the font and color parameters.
Font will be normal font (as if you've chosen 1 as value), colors will default to global settings fore- and background color.
E.g. %V|23|10|-|-|-|-|-|
-
I believe the viewports were designed to automatically assume the width and height as "LCD width - x-pos" and "LCD height - y-pos" in absence of width and height definitions...
Right, I'm sorry, somehow forgot about it. But calculating this for yourself can still be helpful if you want to know the maximum width or as a basis to calculate a slightly smaller viewport width... ;)
As jswetzen said elsewhere:
The old format was:
%P|filename.bmp|
%pb|height|left-position|right-position|y-position(optional)|
and the new one is:
%pb|filename.bmp|x|y|width|height|
To add: in the old format all arguments were optional, e.g. you could only specify a different height for your progress bar and the rest was taken from the default. But you had to keep the order, I mean that if you wanted only the y-position to be different, you had to specify everything else before it (height, left-position, right-position) - couldn't have worked otherwise. This is still possible with the new syntax, only that you use a "-" now, where you don't want anything else than the default. See also http://forums.rockbox.org/index.php?topic=18967.msg136930#msg136930 .