Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Text over image using viewports
« previous next »
  • Print
Pages: [1]

Author Topic: Text over image using viewports  (Read 1929 times)

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Text over image using viewports
« on: April 06, 2008, 12:27:47 AM »
I'm probably gonna get reamed out for this but I just want to let everyone know I looked around for help with this and tried for a few hours to do it via trial and error in the simulator but really got no where.

What I'm trying to do is display text over a image, a changing image.
Specifically display the battery percent over a changing battery image.

I put the main body of the WPS in a viewport then added another viewport with the %bl tag specfiying the position I want it at.
The text isn't another layer but "overwrites" the image. The part of the image the text is covering is totally gone, I can see the background.

I've tried putting the battery images in a viewport then adding a another viewport with the battery tag. Same thing happens.


If you can help me please provide a small example of how to do this, I would greatly appreciate it. Thank you.
Logged

Offline ZincAlloy

  • Member
  • *
  • Posts: 488
Re: Text over image using viewports
« Reply #1 on: April 06, 2008, 09:09:39 AM »
I think this is impossible.
Logged

Offline NicolasP

  • Developer
  • Member
  • *
  • Posts: 195
Re: Text over image using viewports
« Reply #2 on: April 06, 2008, 11:34:48 AM »
The WPS engine isn't meant to allow overlapping elements.
Logged

hhannah

  • Guest
Re: Text over image using viewports
« Reply #3 on: April 06, 2008, 12:02:20 PM »
@Job Van Dam: Instead you might try leaving static the part of the image where the text goes (a viewport just for displaying that text of course, would be displayed over a part of the background main image), and make the images which form the battery around the text change (in separate viewports). Not exactly want you wanted initially, but it could be a good approach... although a bit more complicated depending on your general design... it depends on how important the "% inside the battery" is for you I guess

Edit:



Putting it only in words is not so easy, so I made a little sketch. On the first image, the red lines define the viewports (central part is the % text viewport). You would use four %?bl tags, one within each viewport, all of them with exactly the same amount of conditionals inside. On the first power stages, only the %?bl tag placed in viewport 1 would contain the appropiate filling images for those stages. The %?bl tag conditionals for those stages in viewports 2,3 & 4 would be empty. In the middle power stages, the %?bl tags in viewports 2 & 3 would place the "battery filling" images, while in viewport 1 images for initial power stages would be loaded, and for viewport 4 conditionals would be empty. Similar logic for the final stages. In that way you would achieve displaying something like the 2nd and 3rd icons... using perhaps something more ellaborated under the % text (in my example simulating maybe a lable or a different battery inside look...) again, all this depending of how important it is for you to display this
« Last Edit: April 06, 2008, 10:51:26 PM by hhannah »
Logged

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Re: Text over image using viewports
« Reply #4 on: April 07, 2008, 12:48:17 AM »
Thanks guys, especially hhannah I appreciate the feedback.

I think most likely I'll stick with the way I had it before, timed battery % to battery time.
Logged

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 645
Re: Text over image using viewports
« Reply #5 on: April 08, 2008, 02:57:34 PM »
Maybe it's not a very nice solution but now that bitmap strips are supported you could achieve something like this with a picture of the text. Of course one part each for every percentage is still a lot even if it was just the text with transparent magenta background, but maybe 5% steps could already be grainy enough and still ok to handle? Just thought I'd mention my quick idea even if it's not that handy...
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Text over image using viewports
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.087 seconds with 15 queries.