Box2d world width and height ratio with screen width and height
Posted
by
Sujith
on Game Development
See other posts from Game Development
or by Sujith
Published on 2014-03-04T10:28:10Z
Indexed on
2014/06/03
3:44 UTC
Read the original article
Hit count: 287
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.
© Game Development or respective owner