HTML and CSS Reference
In-Depth Information
Making Your Game Bigger with the
Full-Screen API
With the smaller screens available on mobile devices, anything you can do to maximize the screen real estate
available to your game can benefit playability.
On the desktop, Firefox, Chrome, and Safari have added support for a full-screen API that enables you to
indicate a single DOM element that should be shown full screen. The specification for this API is still in flux.
A working draft is available at .
The API is currently available only with vendor prefixes in desktop browsers. No announcement of support
has been made for mobile browsers, although Apple has announced that iOS 6 will have a full-screen landscape
mode. This mode is different from a full-screen API but should still provide game developers with some extra
screen space.
Locking Your Device Screen with the
Screen Orientation API
Some of the fun that game developers could have with the Device Orientation API, which you saw in Chapter
24, “Querying Device Orientation and Acceleration,” was mitigated because the screen would rotate when you
got past a certain point.
The good news is that there is a W3C specification that can enable web developers to both more accurately
capture the current state of the screen orientation and lock the screen to a specific orientation. The working draft
of this specification is available at .
The only implementation available on devices as of this writing is in the Mozilla Android browser Fennec,
but hopefully Chrome for Android and Mobile Safari will get this API in the future.
Adding Real-Time Communications with
The WebRTC project is an open project that aims to add real-time communications capabilities to web browsers
via a JavaScript API. This includes the ability to make voice and video calls through both a centralized server
and via peer-to-peer. This technology would be a great addition to two-player games to allow players to play
against each other while staying in communication (among a myriad of other users).
The project has a website located at to go along with a draft specification available at .
No current desktop browsers have support for WebRTC, but you can try out a version by using the Chrome
development channel. See the WebRTC website for more details.
Search WWH ::

Custom Search