tags:

views:

77

answers:

1

I am developing a game that uses box2d engine in android. I create the physics world by definitions coming out a xml defined for 320X480 resolution.

Now in box2d I have considered that 1 unit is 30 Pixels. The question is , is there any other option other than defining a separate xml for each resolution to scale this properly for all screens ?

I have tried to get screen density from Display metrics and adjust the scale that box2d uses but the physics world does not look the same.

Anybody ran into this situation and resolved it ?

Thanks in advance.

A: 

You should find a way to rescale your drawing so that independent of resolution you would fit the same number of in-game units on the screen. Sadly I can't help you with the specifics as I don't know the android API.

Staffan E