Devon Smith
Devon Smith

Reputation: 397

How to make Standard game design/layout through Surfaceview

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 another 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.

Upvotes: 0

Views: 497

Answers (1)

Egor
Egor

Reputation: 40218

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.

Upvotes: 1

Related Questions