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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Text "always on top"
« previous next »
  • Print
Pages: [1]

Author Topic: Text "always on top"  (Read 2255 times)

Offline ben106

  • Member
  • *
  • Posts: 2
Text "always on top"
« on: November 09, 2008, 12:52:48 PM »
Hi,
I got a problem creating my WPS (for the Sansa e200) : the progress bar is big (red rectangle on the picture), and I got some text on the progress bar. How can I do so that the text doesn't get covered by the progress bar ?

The text that refreshes (current time, remaining time) doesn't get hidden by the bar but total time and next song get covered (or flickers while scrolling).

I didn't try this on the mp3 player itself (I don't have the player here), so I'm trying on the simulator, on Wine (I got Linux).

Here is my .wps :
Code: [Select]
%wd

%X|back.bmp|

%xl|a|battery.bmp|5|5|4|
%xl|b|volume.bmp|127|14|5|
%xl|c|playMode.bmp|8|195|5|
%xl|d|repeat.bmp|27|195|4|

%?bl<||%xdaa|%xdab|%xdac|%xdad>
%?pv<|%xdba|%xdbb|%xdbc|%xdbd|%xdbe|%xdbe>
%pb|progressbar.bmp|60|131|90|58|
%?mp<%xdca|%xdcb|%xdcc|%xdcd|%xdce>
%?mm<|%xdda|%xddb|%xddc|%xddd>

%Cl|5|30|75|75|
%C



%V|18|2|40|12|-|-|-|
%al%bt

%V|95|2|32|12|-|-|-|
%ar%pvdB

%V|86|50|66|12|-|-|-|
%s%ia

%V|96|73|77|12|-|-|-|
%s%id

%V|34|119|90|12|-|-|-|
%s%it

%V|12|143|115|12|-|-|-|
%s Next : %Ia - %It

%V|140|119|34|12|-|-|-|
%pr

%V|118|180|34|12|-|-|-|
%pt

%V|40|164|34|12|-|-|-|
%pc

%V|72|205|42|12|-|-|-|
%ck:%cM

hope someone can help.. thanks !

* wps.png (65.28 kB, 319x281 - viewed 296 times.)
Logged

Offline karashata

  • Rockbox Expert
  • Member
  • *
  • Posts: 603
  • Just a fluffy dragon with too much time on my paws
    • Alex Vanderpol (karashata) on Twitter
Re: Text "always on top"
« Reply #1 on: November 09, 2008, 02:27:22 PM »
Sadly, you can't really draw text over a progress bar or any other graphics without some sort of complication.  Viewports aren't drawn transparently so any text drawn over a graphic will blank out where the text viewport is, and any graphics drawn over text will hide the text under it.  It's best to try not to overlap viewports because of this.

However, if you really want to have text show over an image, make sure the image is drawn to the screen first, then the text.  This is done by having the image display tag (or in your case, the progress bar tag) before the text you want to have over the image.

I hope that helps some.
Logged
Welp, my iriver H10 20GB is out of commission again.

Offline ben106

  • Member
  • *
  • Posts: 2
Re: Text "always on top"
« Reply #2 on: November 09, 2008, 03:03:17 PM »
Thanks for the reply !
The progress bar tag (%pb) is before the viewports and text. I think the progress bar refreshes (and goes to foreground) maybe every 0.1s, and the text only when the song changes.

I just tried putting the progress bar into a viewport, but same problem.

It would be great having something that makes the text refresh at the same time as the progress bar.
---------------------------------
EDIT :
I now found a solution, not really clean, but works. I changed the display of the total time %pt into %?px<%pt|%pt>. I removed the scrolling for the "next song", replaced it by alternatively printing artist and song.

Here is the new .wps :
Code: [Select]
%wd

%X|back.bmp|

%xl|a|battery.bmp|5|5|4|
%xl|b|volume.bmp|127|14|5|
%xl|c|playMode.bmp|8|195|5|
%xl|d|repeat.bmp|27|195|4|

%?bl<||%xdaa|%xdab|%xdac|%xdad>
%?pv<|%xdba|%xdbb|%xdbc|%xdbd|%xdbe|%xdbe>
%?mp<%xdca|%xdcb|%xdcc|%xdcd|%xdce>
%?mm<|%xdda|%xddb|%xddc|%xddd>

%pb|progressbar.bmp|60|131|90|58|

%Cl|5|30|75|75|
%C

%V|18|2|40|12|-|-|-|
%al%bt

%V|95|2|32|12|-|-|-|
%ar%pvdB

%V|86|50|66|12|-|-|-|
%s%ia

%V|96|73|77|12|-|-|-|
%s%id

%V|34|119|90|12|-|-|-|
%s%it

%V|12|143|115|12|-|-|-|
%Ia;%It

%V|140|119|34|12|-|-|-|
%pr

%V|118|180|34|12|-|-|-|
%?px<%pt|%pt>

%V|40|164|34|12|-|-|-|
%pc

%V|72|205|42|12|-|-|-|
%ck:%cM
« Last Edit: November 09, 2008, 03:39:37 PM by ben106 »
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Text "always on top"
« Reply #3 on: November 09, 2008, 11:52:32 PM »
Quote from: karashata on November 09, 2008, 02:27:22 PM
However, if you really want to have text show over an image, make sure the image is drawn to the screen first, then the text.  This is done by having the image display tag (or in your case, the progress bar tag) before the text you want to have over the image.

I hope that helps some.
I dont tihnk that will work... IIRC the bitmaps are always drawn after text.


ben106.. the simulator can be built nativly for linux... you just need libsdl-dev and gcc...
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline karashata

  • Rockbox Expert
  • Member
  • *
  • Posts: 603
  • Just a fluffy dragon with too much time on my paws
    • Alex Vanderpol (karashata) on Twitter
Re: Text "always on top"
« Reply #4 on: November 10, 2008, 01:14:57 PM »
You could be right, it's been ages since I've tried to draw text over bitmaps and I learned long ago that it didn't work out properly so I've avoided it since...
Logged
Welp, my iriver H10 20GB is out of commission again.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Text "always on top"
 

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

Page created in 0.075 seconds with 15 queries.