RESPONDING TO DEVICE CAPABILITIES

Maximizing Real Estate

the game takes up the full height and width of the available screen real estate.

ADDING A LAUNCHER

embeded with other content on the page, you may want to add a launcher step to your game when you

wait for an action from the user before you start loading the game

increase the viewable area of the game on the desktop, but this can cause additional problems.

You also generally want your game to play similarly whether it's played on the desktop or a mobile device.

maximize the game to certain size when it's on a mobile device but

leave it in a container of fixed size when users play your game on the desktop.

Ideally you should develop your game in such a way that the exact dimensions and aspect aspect

ratio don't matter

depending on the genre.

the amount of the level visible on the screen shifts depending on the screen size and

dimensions.

ensure you maximize the size of the playable area while keeping the aspect ratio constant.

Using a fixed aspect ratio can lead to some less than -ideal situations because may device

have vastly differing aspect rations for landscape and portrait mode.

you can optimize only for one view   either portrait or landscape

either ask the user to rotate the device

you don't have the ability to lock screen rotation in HTML5

Resizing Canvas to Fit

boilerplate HTML and a <canvas> element that]s 480 pixels by 480 pixels centered on the page'

原文地址:https://www.cnblogs.com/yushunwu/p/2738171.html