What's the best way to handle all screens sizes?

68 views
Skip to first unread message

d.c...@sdkmedia.net

unread,
May 16, 2013, 12:48:24 PM5/16/13
to mel...@googlegroups.com
Hi folks,

I try to figure out how I can adapt my game to different screens sizes. For example, if my window size is 480x320 when I resize it the game doesn't use all the page. So what's the best solution for this problem?

Oh and by the way can you give me an example to integrate the fullscreen API or some good links?

Thanks

(sorry for my English)

Jay Oster

unread,
May 16, 2013, 7:06:21 PM5/16/13
to mel...@googlegroups.com
You can pass a special "auto" scale value to the me.video.init() function to automatically scale the canvas to any browser/screen size: http://melonjs.github.io/docs/me.video.html#init This is fine for most cases.

I once tried making a game that could dynamically scale to the available screen size without stretching the canvas, but it turned out awful, because gameplay mechanics changed depending on the screen size. It was not good. Definitely recommend using the video scaling feature and live with lower quality graphics on higher resolution displays. (At least for your first game!) I'm going to attempt to do a game that can display low resolution and high resolution (2x pixel area) images depending on available screen space.
Reply all
Reply to author
Forward
0 new messages