开发者

How do I create a canvas the size of the window resolution without scaling?

开发者 https://www.devze.com 2023-03-19 14:01 出处:网络
I would开发者_开发问答 like to create a 2d space game which can be played as a web app on several devices such as pc, iphone, android, and ipad.I would like to detect screen resolutions automatically

I would开发者_开发问答 like to create a 2d space game which can be played as a web app on several devices such as pc, iphone, android, and ipad. I would like to detect screen resolutions automatically and adjust the canvas resolution to match. As the resolution changes from device to device I plan to show more or less of the map. I will adjust space ship sizes programmatically if need be. Any ideas on how I can do this? I'm new to javascript and web development.


There is a jQuery plug-in called Supersized that does exactly what you're asking for. It gives you a full screen image background, no matter what size the screen is. If you can use jQuery this is one way to go.

0

精彩评论

暂无评论...
验证码 换一张
取 消