Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: karltpb on March 31, 2008, 11:17:30 PM

Title: Viewports overlapping album art
Post by: karltpb on March 31, 2008, 11:17:30 PM
Hi, I'm working on porting JBlackGlass theme to use viewports. I've been stuck with a weird problem lately. A blank line shows over the album art all the way across a viewport. (Screen dumps are attached with this post)

Here's the WPS:

Code: [Select]
#Theme Name: jBlackGlass
#By: Pies Julius
#Platform: iPod video (320x240x16) - Unsupported
#Patches Required:Album Art, Customline, Custom list pos, Custom Display width,
#                 Multifont, Multifont-userfonts, BMP resize (optional)
#Recommended Builds: jbuild, EvilG
#Version: 1.1
#Licenced: ???
#Graphics taken from: original work, inspired by WMP11
#Last updated: Sat, 26th May 2007

# disable the status bar
%wd
# background
%X|bg.bmp|
# preloading images
%P|pb.bmp|
# playback images
%xl|a|stop.bmp|87|200|
%xl|b|play.bmp|87|200|
%xl|c|pause.bmp|87|200|
%xl|d|next.bmp|87|200|
%xl|e|prev.bmp|87|200|
%xl|f|vol0.bmp|221|200|
%xl|g|vol1.bmp|221|200|
%xl|h|vol2.bmp|221|200|
%xl|i|vol3.bmp|221|200|
%xl|j|vol4.bmp|221|200|
%xl|k|vol5.bmp|221|200|
%xl|l|vol6.bmp|221|200|
%xl|m|vol7.bmp|221|200|
%xl|n|vol8.bmp|221|200|
%xl|o|vol9.bmp|221|200|
%xl|p|vol10.bmp|221|200|
%xl|q|bat0.bmp|289|0|
%xl|r|bat1.bmp|289|0|
%xl|s|bat2.bmp|289|0|
%xl|t|bat3.bmp|289|0|
%xl|u|bat4.bmp|289|0|
%xl|v|repeat.bmp|33|200|
%xl|w|repeat1.bmp|33|200|
%xl|x|repeatsh.bmp|33|200|
%xl|y|power.bmp|289|0|
%xl|z|charge.bmp|289|0|
%xl|A|hold.bmp|242|0|
%xl|B|shuffle.bmp|9|200|
%xl|C|hdd.bmp|267|0|
%xl|D|repeatab.bmp|33|200|
%xl|E|bat5.bmp|289|0|
%xl|F|bat6.bmp|289|0|
%xl|G|bat7.bmp|289|0|
%xl|H|bat8.bmp|289|0|
%xl|I|bat9.bmp|289|0|
%xl|J|bat10.bmp|289|0|
%xl|K|bat11.bmp|289|0|
%xl|L|bat12.bmp|289|0|

# Display Hold, HDD & Battery icons
%?mh<%xdA|>
%?lh<%xdC|>
%?bl<%xdq|%xdr|%xds|%xdt|%xdu|%xdE|%xdF|%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL>
%?bp<%xdy|>
%?bc<%xdz|>

# Display Shuffle & Repeat icons
%?ps<%xdB|>
%?mm<|%xdv|%xdw|%xdx|%xdD>

# Display Play status & Volume bar
%?mp<%xda|%xdb|%xdc|%xdd|%xde>
%?pv<%xdf|%xdg|%xdh|%xdi|%xdj|%xdk|%xdl|%xdm|%xdn|%xdo|%xdp>

# Display misc Viewports
%V|133|42|167|14|1|FFFFFF|000000|
%al%s%?ia<%ia|%?d2<%d2|(Artist Unknown)>>
%V|133|56|167|14|1|FFFFFF|000000|
%al%s%?id<%id|%?d1<%d1|(Album Unknown)>>
%V|133|70|167|14|1|FFFFFF|000000|
%al%s%?it<%it|%fn>
%V|113|100|187|14|1|FFFFFF|000000|
%alTrack: %pp of %pe - %pc [%pt]
%V|113|114|187|22|1|FFFFFF|000000|
%alCodec: %fc (%fbkbps)
%V|70|154|215|14|1|FFFFFF|000000|
%al%sNext: %?It<%It|%Fn>

# Display Date, Time & Battery status
%V|117|5|124|14|1|FFFFFF|000000|
%al%cb %cd, %cH:%cM;%alBattery: %bt

# Display Progress Bar
%V|0|184|320|9|1|FFFFFF|000000|
%pb|9|0|320|0|

# Display Album Art
%V|7|35|100|100|1|FFFFFF|000000|
%Cl|0|0|s100|s100|
%C

As you can see a few conditionals are not in viewports. I think this is what's interfering with the album art, but unfortunately the conditionals don't work in viewports, at least in this case.

Could someone please help me out?

Thanks.
Title: Re: Viewports overlapping album art
Post by: kperri on March 31, 2008, 11:50:18 PM
I'm not an expert of WPS code, but I think the problem is the conditionals outside of the viewports, for example the one causing you trouble is the Disk Activity conditional. Conditionals like those from what I have found in my own WPS creations will create completely blanked out lines in a WPS when their condition is true.

You can fix this problem by defining viewports for those conditionals. Remember that in these viewports the images' coordinates are relative to the viewport's coordinates.

Anyone, please correct me if my thinking is wrong.
Title: Re: Viewports overlapping album art
Post by: Llorean on April 01, 2008, 12:19:16 AM
The general intent with viewports is that everything should always be within one.
Title: Re: Viewports overlapping album art
Post by: karltpb on April 01, 2008, 12:23:59 AM
The conditionals don't work at all inside viewports in this case. I tried that a couple of times before asking for help.  :(

@Llorean: I'm not able to make out what exactly you mean. Could you elaborate a bit on it?
Title: Re: Viewports overlapping album art
Post by: Llorean on April 01, 2008, 12:33:17 AM
Everything in the WPS should always be in a viewport.
Title: Re: Viewports overlapping album art
Post by: karltpb on April 01, 2008, 03:05:05 AM
Okay, well I tried it yet again but had no success. The conditionals don't work at ALL in viewports. Here's the code:

Code: [Select]
# Display Hold, HDD & Battery icons
%V|242|0|78|25|1|FFFFFF|000000|
%?mh<%xdA|>
%?lh<%xdC|>
%?bl<%xdq|%xdr|%xds|%xdt|%xdu|%xdE|%xdF|%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL>
%?bp<%xdy|>
%?bc<%xdz|>

# Display Shuffle & Repeat icons
%V|9|200|49|23|1|FFFFFF|000000|
%?ps<%xdB|>
%?mm<|%xdv|%xdw|%xdx|%xdD>

# Display Play status & Volume bar
%V|87|200|222|23|1|FFFFFF|000000|
%?mp<%xda|%xdb|%xdc|%xdd|%xde>
%?pv<%xdf|%xdg|%xdh|%xdi|%xdj|%xdk|%xdl|%xdm|%xdn|%xdo|%xdp>

I even tried putting each conditional in its own viewport, but it didn't work.  :-\
Title: Re: Viewports overlapping album art
Post by: Llorean on April 01, 2008, 03:12:37 AM
I don't know too much about viewports in WPSes yet, sadly. But this is important, which SVN revision are you using?
Title: Re: Viewports overlapping album art
Post by: karltpb on April 01, 2008, 03:16:33 AM
I'm using revision 16884, which is about 2 days old.
Title: Re: Viewports overlapping album art
Post by: pixelma on April 01, 2008, 07:48:23 AM
Conditionals work in viewports. If I see correctly, your problem is that you position the images outside the viewports. Images are now placed on a per viewport basis - the x and y coordinates are relative to the viewport's upper left corner, counting the viewport you have the %xd tag in.

For example:
Code: [Select]
%xl|x|example.bmp|0|0|
%V|87|200|222|23|1|FFFFFF|000000|
%xdx
This would display the image in the upper left corner of the viewport which is at position 87/200 of your display.
Title: Re: Viewports overlapping album art
Post by: karltpb on April 01, 2008, 09:51:17 AM
Thank you, it worked.

I feel stupid I never paid any attention towards the images.  :-[
Title: Re: Viewports overlapping album art
Post by: lights0ut on April 03, 2008, 08:27:30 PM
just as a side note, I've started a port of jclix to viewports. Just have to get rid of the box in the menu images.

edit: (almost) done, just can't decide on a gradient... 
decided just to use the ol' colour wheel and use the compliment to the main backdrop colour.
screens below, I'm off topic.
EDIT done: http://forums.rockbox.org/index.php?topic=16228.0
Title: Re: Viewports overlapping album art
Post by: hhannah on April 04, 2008, 01:45:41 AM
Looks fantastic!  ;)

regarding the gradient, the original white did look just fine, was consistent, and suits all the possible backgrounds, doesn't it?