Rasive
Rasive

Reputation: 1143

Rendering my world according to my model

I have two questions:

The first being why exactly my Box2D Body is twice the size of my GameObjects size? I am probably doing something wrong, but it seems odd that the two are aligned perfectly, so the units between my model and my renderer match up.

Second question I have, is if I can somehow change the projection the SpriteBatch uses to place objects on the screen, instead of moving my camera?

The picture here explain my two problems quite well

enter image description here

Upvotes: 0

Views: 211

Answers (1)

Aurelien Ribon
Aurelien Ribon

Reputation: 7634

  1. I think you used setAsBox() method on your PolygonShape. this method only takes the half-width and half-height of the box. So if you give it the full size, it will be twice as large and twice as high.
  2. spritebatch.setProjectionMatrix()

Upvotes: 1

Related Questions