Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For some reason I am having the issue where the following code:

 global.spriteBatch.Draw(obj.sprite, obj.getPosition(), null, Color.White, obj.rotation,, 2f, SpriteEffects.None, 1);

causes the object to rotate around the origin in such a way, as though there is an offset to the position relative to its location. The calculation for the center it correct and this happens even if I set the pivot to be the location of the object. The further I get from 0:0 the larger the radius or rotation. I am not sure what is going on here because given the following tutorial

I have done the code setup correctly. Any ideas? Any help is greatly appreciated!!!

share|improve this question

This was a bit of stupid mistake. I assumed the the origin was relative to the world when its not. The origin is the offset to the object. To get the offset, you can simply do the following: - obj.getPosition

for the origin and it will give you your offset for your center.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.