HTML and CSS Reference
Making Your Game Bigger with the
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 http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html .
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
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
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
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 www.webrtc.org 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.