Box2d world width and height ratio with screen width and height
- by Sujith
I have view, for example GameView which extends SurfaceView . I have integrated Box2D physics in GameView. I have two widths ,
GameView width, height and Box2D physics world width ,height. I need to get the position of box2d world with the GameView co-ordinates.
For example,
Total width of screen = 240
Total height of screen = 320
Screen points needed to be mapped onto box2d co-ordinates (x,y) = 127, 139
For this i need to get the max width and height of the Box2d physics world. Is there is any way to get the max width and height of Box2d world.
or
Can i limit the width and height of box2d world within the screen resolution.