Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: bzavala on March 25, 2008, 02:46:23 AM

Title: Viewports: images on WPS are not being displayed
Post by: bzavala on March 25, 2008, 02:46:23 AM
Hi all...

I just took today's SVN. Since viewports for WPS has been commited, I decided to try a WPS theme I'm working on right now, using viewports.

All the lines are being displayed fine. My album art is displaying fine, but the battery level, volume levels, play/pause and all other icons, are not being displayed.  

I read somewhere that there is a limit on the amount of images and amount of size that is loaded, so I limited it to only 5 small images (play, pause, rewind, foward, hard drive activity) but still, with only these 5 images, I am unable to display them at all.

Has anybody been successful in creating/porting a theme to use viewports? It must have been a recent changed that I missed, since I was able to make it work a couple of weeks ago when there was a thread on the unsupported builds forum.

Thanks in advance,

Ben

Title: Re: Viewports: images on WPS are not being displayed
Post by: Llorean on March 25, 2008, 02:58:08 AM
Which revision is your build?
Title: Re: Viewports: images on WPS are not being displayed
Post by: linuxstb on March 25, 2008, 04:15:53 AM
As Llorean implied, please make sure you're running the very latest current build - there have been a few bugfixes committed related to viewports.

If you still have the problem, can you attach your .wps file?
Title: Re: Viewports: images on WPS are not being displayed
Post by: Hweb21 on March 25, 2008, 10:52:54 AM
I had this problem too. I fixed it by puting all my image code and image conditions before the viewport code(I usally put them at the end).
Code: [Select]
%wd
%X|bground.bmp|
%P|pbar.bmp|
%xl|a|batt0.bmp|125|7|
%xl|b|batt1.bmp|125|7|
%xl|c|batt2.bmp|125|7|
%xl|d|batt3.bmp|125|7|
%xl|e|batt4.bmp|125|7|
%xl|f|play.bmp|11|8|
%xl|g|pause.bmp|11|8|
%xl|h|vol0.bmp|50|111|
%xl|i|vol1.bmp|50|111|
%xl|j|vol2.bmp|50|111|
%xl|k|vol3.bmp|50|111|
%xl|l|vol4.bmp|50|111|
%xl|m|vol5.bmp|50|111|
%xl|n|vol6.bmp|50|111|
%xl|o|vol7.bmp|50|111|
%xl|J|norep.bmp|11|114|
%xl|K|rep.bmp|11|114|
%xl|L|rep1.bmp|11|114|
%xl|M|repS.bmp|11|114|
%xl|N|repAB.bmp|11|114|
%xl|O|shuff.bmp|11|114|
%xl|I|hdd.bmp|37|114|
%?bl<%xda|%xdb|%xdc|%xdd|%xde>
%?pv<%xdh|%xdi|%xdj|%xdk|%xdl|%xdm|%xdn|%xdo>
%?mp<%xdg|%xdf|%xdg|%xdf|%xdf>
%?ps<%xdO|%?mm<%xdJ|%xdK|%xdL|%xdM|%xdN>>
%?lh<%xdI|>
%pb|2|10|150|80|
%V|50|5|60|12|1|B8B8B8|000000|
%ac%pc/%pt
%V|11|25|136|73|1|B8B8B8|000000|
%al%s%?C<%m|51|%?it<%it|%fn>|%?it<%it|%fn>>
%al%s%?C<%m|51|%?ia<%ia|Unknown Artist>|%?ia<%ia|Unknown Artist>>
%al%s%?C<%m|51|%?id<%id|Unknown Album>|%?id<%id|Unknown Album>>
%al%s%?C<%m|51|%?id<%?iy<%iy|%fc>|%fc>|%?id<%?iy<%iy|%fc>|%fc>>%ar%pp/%pe
%Cl|0|0|sc50|sc50|
%?C<%C|>
%V|24|87|124|12|1|B8B8B8|000000|
%al%s%?Ia<%Ia|> - %?It<%It|%Fn>
%V|81|112|23|12|1|B8B8B8|000000|
%ar%pv
%V|105|112|46|12|1|B8B8B8|000000|
%ar%cl:%cM
Title: Re: Viewports: images on WPS are not being displayed
Post by: bzavala on March 25, 2008, 12:36:40 PM
I am using r16796-080325 and the issue still happens.

I did what Hweb21 suggested and I put all the images before the viewports and that fixed it.  So thanks!!

I am having another issue now: I am getting white lines over the album art.. it might be because I am placing viewports to the left of the album art image. I'll play around with it and report any issue I find.

Thanks again all!

Ben

EDIT: Now that I think about it... is a viewport necessary for the albumart itself?
Title: Re: Viewports: images on WPS are not being displayed
Post by: linuxstb on March 25, 2008, 03:03:32 PM
My advice would be to split your WPS into a set (you can have up to 15) non-overlapping viewports, and draw all the different elements of your WPS into those viewports.

Everything before the first %V line is drawn in a default full-screen viewport - but this is mainly for backwards compatibility - for new WPSs I would suggest not using the default.

And remember that all items (including images displayed with %xd) are drawn on the screen relative to the viewport they are contained in - so the co-ordinates you give the image with %xl must be relative to the viewport, not relative to the top-left corner of the screen.  This seems to be the most common mistake.

And to answer bzavala's question, yes, I would put albumart in its own viewport.
Title: Re: Viewports: images on WPS are not being displayed
Post by: bzavala on March 25, 2008, 05:51:11 PM
great... using multiple viewports for each section works fine; this fixed the blank lines over the album art.

I ended up using 13 viewports but it worked. I know the limit is 15.

Thanks linuxtb!