Quick Links: Gideros Home | Download Gideros | Developer Guide
Rotating a group sprite about its center point
  • Hi everyone,

    I've been running into some issues when attempting to rotate a group sprite (and hence all its children) about the group sprite's defined center point. Essentially what I want to accomplish is rotate all children around the group sprites anchorpoint by calling Group:setRotation. However, whenever I do this, the group sprite seems to rotate around the upper left anchor point (or something like that) rather than the center point. I have attached a quick example code to show essentially what my code resembles. Would anyone happen to know how to accomplish this? Thanks!
  • SinisterSoftSinisterSoft +1 -1
    Can you post a copy of the entire project (inc gfx)? - that makes it easier for someone to try it and get back to you as to what has gone wrong.
  • hgy29hgy29 +1 -1 (+1 / -0 )
    Maintainer Accepted Answer
    Gideros keeps the anchor point as an absolute value internally, so your initial setAnchorPoint is converted to the center of the group at the time the function is called. And since it is empty it will be 0,0. Either move it to after you have added content to your group, or use setAnchorPosition instead and give him the expected absolute anchor position.

    Likes: SinisterSoft

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

In this Discussion

Top Posters