开发者

How to make Standard game design/layout through Surfaceview

开发者 https://www.devze.com 2023-04-05 16:38 出处:网络
I have used SurfaceView in my game. Right Now, I have created layout considering one device (320 x 480). The game layout looks nice and all functions are working properly. But when I see the same game

I have used SurfaceView in my game. Right Now, I have created layout considering one device (320 x 480). The game layout looks nice and all functions are working properly. But when I see the same game in anot开发者_运维知识库her device with different dimension (screen size), the layout does not seem to be proper.

So is there any property, method, formula or helping Tutorial by which I can create game design/layout through canvas which looks same in all screen size devices.


There is one simple hint: don't ever use absolute coordinates on the SurfaceView. Every item's position should be calculated at runtime depending on the actual screen size. This way you'll achieve a layout that will look the same way on every device. Hope this helps.

0

精彩评论

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