| Home | Forums | Register | FAQ | Search | Today's Posts | Mark Forums Read |
|
Welcome to the misticriver forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Displaying text at X and Y coordinates
I really just want to know if this is possible. I could not find instructions to do this anywhere on the Rockbox web site, so I have resorted to using the spacebar and return key to place all the text. However, there is one place in my WPS that needs to be at an exact Y coordinate.
|
|
|||
|
Yes, there is a way.
Goodness man, resorting to using the spacebar?!?!? Geez, what patience... Anyway, I will give you an example from my "oranges WPS": %e|104|12|100|4|000000 |%s%ac%?ia<%ia|%?d2<% d2|Artist Unknown>> The example of WPS code above displays artist info. Now, here is the breakdown on text placement (the bold part above): %e|x-position|y-position|pixels or distance to be used after the x-position|font to be used|font color| Concerning the first slot, or "x-position": Self-explanatory. X-coordinate starting point of text to be displayed. In our example, the "104" means text starts 104 pixels counting from the left of the screen (the screen is 220x176). Example: %e|104|12|100|4|000000|%s% ac%?ia<%ia|%?d2<%d2| Artist Unknown>> Concerning the second slot, or "y-position": Self-explanatory. Y-coordinate position of text to be displayed. In our example, the "12" means text starts 12 pixels counting down the top of the screen (the screen is 220x176). Example: %e|104|12|100|4|000000|%s%ac% ?ia<%ia|%?d2<%d2|Art ist Unknown>> Concerning the third slot, or the "pixels to be used after the x-postion": you can't write the direct x-coordinate where you want text to end, instead, you must tell the wps how much room to reserve past the starting x-position. In our example above, the text starts at x-position "104" with y-position "12." I wanted the text to end at x-position "204," so 204 minus 104 equals 100 pixels. Hence, the 3rd slot tells the WPS to use "100" pixels of distance after the starting point. Example: %e|104|12|100|4|000000|%s%ac%?ia< %ia|%?d2<%d2|Artist Unknown>> THE FOLLOWING OPTION IS FOR MULTIFONT BUILDS ONLY! Such as Ashen's multi-font build, for example. Concerning the fourth slot, or the "font to be used": This tells the WPS which font to use in that given line. In the example, we see the number "4" right? Well, that "4" is telling Rockbox to look up "userfont 4" in the corresponding "themes" file. My themes file looks like this: # Screaming Orange theme for Screaming Oranges Inskin # Idea suggested by grantman54, design by alejandro # Requires lots of patches! # backdrop: /.rockbox/backdrops/orange.bmp # wps: /.rockbox/wps/oranges.wps # # font: /.rockbox/fonts/snap.fnt userfont2: /.rockbox/fonts/nedore-9.fnt userfont3: /.rockbox/fonts/nimbus-12.fnt userfont4: /.rockbox/fonts/helvB12.fnt userfont5: /.rockbox/fonts/helvR10.fnt userfont6: /.rockbox/fonts/helvR8.fnt menufont: /.rockbox/fonts/snap.fnt browserfont: /.rockbox/fonts/snap.fnt recordont: /.rockbox/fonts/snap.fnt tunerfont: /.rockbox/fonts/snap.fnt # foreground color: 000000 background color: ff00ff See where it says "userfont4: /.rockbox/fonts/helvB12.fnt"? That is what the WPS is pointing to in the fourth slot! Here is the example line of code so you can see what I mean: Example %e|104|12|100|4|000000|%s%ac%?ia<%i a|%?d2<%d2|Artist Thus, if I were to change the above bold "4" to "2," I'd be using the nedore-9 font as opposed to the helvB12 font because my "WPS" file is reading the corresponding userfont in the "themes" file. Concerning the fifth slot, or "font color": Finally, we have the fifth slot, which shows "000000" as you can see. This basically is the color of the font. In this case, "000000" means black. Thus, you can essentially use different colors for each line of text you display if you wish to do so. Example: %e|104|12|100|4|000000|%s%ac%?ia<%ia|%?d2< %d2|Artist Unknown>> It took me a couple of days to figure all this out on my own, just like you are trying to do. I figured I'd save you the trouble. Hope this clarifies everything. Edit: seems that x-y positioning is not standard on all builds. =( Last edited by alejandro : December 2nd, 2006 at 08:11 PM. |
|
|||
|
just wanted to give props to alejandro. HE IS VERY NEW at rockbox, at making wpss, and he already understands it completely and is teaching others. This is why I love mistic river
__________________
H320: 18 movies | 24 music videos | 3400 songs | 400 pictures |RockBox Optimized, 1.29 K | Screaming Oranges Inskin | 60+ Gameboy games | EP630s earbuds | Altec Lansing portable speakers| ALL THANX TO MISTICRIVER my only resouce! |
|
||||
|
The tutorial alejandro gave, while very good, is only for builds that support multifonts and x/y positioning. ie. those created for the jclix themes.
When making CVS compatible wps's the only way to place text is by lines and with the space bar at present
__________________
Guide to changing H300 batteries |
|
|||
|
Hmmm, I didn't know the x-y positioning was limited to certain builds only. I knew that multifont support was scarce, but I thought something as crucial as x-y coordinating was standard across builds.
I guess I got lucky when I based my 1st wps on Ashen's multifont build. Oh well... |
|
||||
|
Yeah, its been something needed for a while and i think it was on the targets for the proposed November release (now void). Just hasn't been updated from using the small archos screens that only use a few lines.
__________________
Guide to changing H300 batteries |
|
|||
|
The devs are working on such feature which allows to position every element of a WPS. I think this is one (or even THE) of the reasons why we still don't have RB 3.0.
__________________
WPS Collection for Rockbox Experimental | WPS Collection thread I need help (PHP) |
|
|||
|
%e|104|12|100|4|000000| <- customline + multifont + userfonts patch
__________________
www.handmadematters. tk |