Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Box2d anchor point? — Gideros Forum

Box2d anchor point?

misterhupmisterhup Member
edited March 2016 in General questions
Hi! I would like to ask a quick question: Is there a way to change the anchor point of a box 2d object? Also, I would like to apologize if I was kinda annoying these days with all these basic questions, but I am putting something together and I would like to finish the project soon. So, expect questions like this just for maximum 1 day or 2, then I'll think trough my questions a little bit more. And thanks for the patience :)

Comments

  • antixantix Member
    Ask away, you have a long way to go until your questions are as silly as some of mine :))

    How do you mean anchor point? Do you mean for when you attach a sprite graphic to the body? or when you want to rotate the body?
  • The rotation one, so when I rotate the sprite, it will surround that point.The only problem here is that it seems that "setAnchorPoint" works differently for box2d object, compared to the way it works with normal sprites...
  • Also don't underestimate my silliness, if I keep the questions at this rate, I may very well catch up :))
  • ar2rsawseenar2rsawseen Maintainer
    if you user predefined circle or box shapes, their centers are always in the middle.
    You could do it by drawing a shape around 0 dot where you want center to be.

    But it would be better to understand what you want to achieve, so we could provide the best solution :)

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    Okay generally you set the sprites rotation based on the rotation of the body, not set the body rotation based on the rotation of the sprite.
Sign In or Register to comment.