Support and General Use > Theming and Appearance Customization

Unexpected viewport behavior

(1/2) > >>

HornetMaX:
Let's imagine the .sbs defines the UI viewport as follows:

--- Code: ---%Vi(t,0,8,-,-,1)
--- End code ---
With an 8pt font, the Sansa Clip+ display is 8 lines tall.
The above means hence that the custom UI viewport spans lines 2 to 8.
This is confirmed creating a .wps as follows:

--- Code: ---1 WPS
2 WPS
3 WPS %St(statusbar)
4 WPS
5 WPS
6 WPS
7 WPS
8 WPS
9 WPS
0 WPS

--- End code ---
With the above .sbs ans wps, the display will show an empty first line and lines "1 WPS" ..."7 WPS" will be displayed on lines 2 to 8.

However, modifying the .wps as follows:

--- Code: ---%V(0,0,-,-,0)
1 WPS
2 WPS
3 WPS %St(statusbar)
4 WPS
5 WPS
6 WPS
7 WPS
8 WPS
9 WPS
0 WPS
--- End code ---
Lines "1 WPS" ... "8 WPS" are displayed on lines 1 to 8.

Said otherwise, it seems to me that the X and Y coords in the %V and %Vd commands are absolute to the screen and not relative to the UI viewport.

If that's the case, then I don't get the interest of defining a UI viewport in the .sbs if, anyway, it can be overridden by any %Vd in the .wps and as the .wps have no way to know the size/position of the UI viewport.

In the .wps you are sure to honour the UI viewport if and only if you always draw in the default viewport (i.e. if you don't use any %V / %Vd), which is a hell of a constraint.

Am I missing something ?

MaX.

EDIT: typo fixed.

[Saint]:

--- Quote from: HornetMaX on April 13, 2011, 01:10:17 PM ---In the .wbs you are sure to honour the UI viewport if and only if you always draw in the default viewport (i.e. if you don't use any %V / %Vd), which is a hell of a constraint.

--- End quote ---

Paste your entire theme, or link to it, instead of some fantasy code, so we can have a look at what you're actually doing instead of speculating on what might be wrong with code that other people manage to manipulate.

btw: So in future searches can point to this correctly, it's ".wps" ("while playing screen")


[St.]

HornetMaX:
I'll paste the entire theme here, as the forum does not allow to attach .zip, .fms, .sbs (I can understand for the .zip, but why not .sbs nor .fms ?).
Sorry for the wps typos, I'll edit the original message.

MaX.

vp2.cfg:

--- Code: ---wps: /.rockbox/wps/vp2.wps
sbs: /.rockbox/wps/vp2.sbs
fms: /.rockbox/wps/vp2.fms

font: /.rockbox/fonts/08-Schumacher-Clean.fnt

--- End code ---

vp2.sbs:

--- Code: ---# UI viewport.
%Vi(-,0,8,-,-,1)

%V(0,0,-,8,0)
STATUS BAR

--- End code ---

vp2.wps:

--- Code: ---# Enable status bar.
%we
%V(0,0,-,-,0)
1 WPS
2 WPS
3 WPS %St(statusbar)
4 WPS
5 WPS
6 WPS
7 WPS
8 WPS
9 WPS
0 WPS

--- End code ---

vp2.fms:

--- Code: ---# Enable status bar.
%we
1 FMS
2 FMS
3 FMS %St(statusbar)
4 FMS
5 FMS
6 FMS
7 FMS
8 FMS
9 FMS
0 FMS

--- End code ---

Here's the display output for WPS and FMS:

WPS:

--- Code: ---STATUS BAR
2 WPS
3 WPS top
4 WPS
5 WPS
6 WPS
7 WPS
8 WPS
--- End code ---

FMS:

--- Code: ---STATUS BAR
1 WPS
2 WPS
3 WPS top
4 WPS
5 WPS
6 WPS
7 WPS
--- End code ---

See the issue ?

JdGordon:
Point out where it says viewports *aren't* screen relative and that will be fixed... Viewport coordinates have always been relative to 0,0 of the LCD (i.e top left). and of course nothing requires you to stay in the default viewport in the wps (just expect wierdness if you dont)

HornetMaX:

--- Quote from: JdGordon on April 14, 2011, 02:40:28 AM ---Point out where it says viewports *aren't* screen relative and that will be fixed... Viewport coordinates have always been relative to 0,0 of the LCD (i.e top left). and of course nothing requires you to stay in the default viewport in the wps (just expect wierdness if you dont)

--- End quote ---
Hi,
nowhere it is said viewports *aren't* screen relative.
But I'd think that it would be nice to be able to define viewports that are relative to the default viewport.

%Vd(0,0,...)  --> viewport relative to screen
%VD(0,0,...)  --> viewport relative to default viewport (if defined, else assume full screen).

It would semplify a lot the code of .fms/.wps in some occasions.

MaX.

Navigation

[0] Message Index

[#] Next page

Go to full version