03 February 2010

Wii Flash Lite - full screen size

While debugging my Poulpytris port (still in alpha stage), I found another strange thing.

Although screenResolutionX returns 640 and screenResolutionY returns 800, the fullscreen size is different.
Even worst,it could be different according user 'Toolbar Display' settings.

(toolbar option on a Wii...in french)

Here you have 3 choices
- Always display toolbar (default)
- Auto-Hide toolbar (show toolbar on rollover toolbar zone)
- Button toggle (show toolbar on demand with button1)

Using window.innerHeight & window.innerWidth, I found the final fullscreen value
- Always display toolbar = 800x508
- Auto-Hide toolbar = 800x608
- Button toggle = 800x608

So basically, to handle the 3 modes, you have to follow these steps
- create a 800x608 FLA
- design your UI with nothing 'important' on the last 100 pixels
- remove any margin with
<body style="top:0px;left:0px;margin:0px;">
- place on the first image the magic
- using wiicade, on initializeWiiCadeAPI, replace the Flash detection (assuming you have one and only SWF on screen) with
var tags = document.getElementsByTagName("object");
var objectFlash = tags[0];
objectFlash.height = window.innerHeight;

The Flash is so resized to 508 when needed.
Why not used a 800x608 on all cases ? to avoid the scrolling with B button on the first case!

Unfortunatly there is one 'feature' we can't handle on every settings : the scrolling.
I don't know why but, in this last version, Opera added a very annoying feature, activated by default: horizontal margins

I really don't understand the meaning of this, perhaps for some kind of TV screen, but anyway, with this option, Opera keeps a 10 (20?) pixels margin before and after the HTML document.

This extra zone is inactive, input isn't handled there.
So very annoying and, I repeat, ACTIVATED BY DEFAULT.
Plus, you can't detect it, to show an alert or similar.
Since you can't intercept B button, you can't desactive scroll and you stuck with this, unless the player desactivated the option...which means almost never!

If someone find a hack for this (or a way to detect the option), I'm very interested in!

Oh, I also found a bug on Opera :
if you select Auto Hide toolbar, it automatically zooms to 120%
also annoying since I hook the zoom button : no way to zoom back to 100%

No comments: