Libgdx box2d body is being place at the wrong y coordinate

Anything libgdx related goes here!

Libgdx box2d body is being place at the wrong y coordinate

Postby Jasonpaul » Fri Jan 11, 2019 7:34 pm

I have been working with box2d and am having a problem where my body is not being set to the correct y coordinate when I try to position it at the bottom right of the screen. movies download movies at forum


I am trying to set the y coordinate to 0 so that the body aligns directly with the bottom of the screen. However, the half of the body is hanging off the screen. Even when I print out the body's location, it says the y is at 0.

I have my pixel per meter set at screenHeight / 80 which comes out to be around 25 PPM for the current devise I am using. I am not sure if my scaling is causing something weird to happen.
Last edited by Jasonpaul on Sat Jan 12, 2019 7:19 pm, edited 1 time in total.
Jasonpaul
 
Posts: 3
Joined: Fri Jan 11, 2019 7:32 pm

Re: Libgdx box2d body is being place at the wrong y coordina

Postby evilentity » Fri Jan 11, 2019 7:44 pm

Box2d stuff like circles and rects have their position in the center not bottom left like most gdx things.
Looking for a freelancer? PM me!
Check out libgdx discord server!
evilentity
 
Posts: 4734
Joined: Wed Aug 24, 2011 11:37 am


Return to Libgdx

Who is online

Users browsing this forum: Exabot [Bot], hoangtunho2611 and 1 guest