Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
setAnchorPoint() on a parent Sprite - Unexpected behavior? — Gideros Forum

setAnchorPoint() on a parent Sprite - Unexpected behavior?

MellsMells Guru
edited October 2013 in General questions
Hi,

here is a case : when I'm setting the anchor point on a parent sprite, the anchor point is modified on all its children instead of the parent sprite only.
I was expecting a different behavior.
Here is an image explaining the situation.

(2) is what is happening. (3) is what I was expecting would happen.

image

Am I the only expecting (3) instead of (2)?
twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps

Comments

  • yes one of the reasons why setAnchorPoint is not natively available, because there are tons of ways to implement it, and none of them can be absolutely right.

    As explained on that other post, why not implemented and how to manage what you want, setting anchorpoints to sprite, actually changes its 0;0 coordinate to the provided anchor point, thus also all children change position.

    you could add another sprite layer and position it with -width/2 -height/2 position within container, and add heart to it, ti would behave how you would expect it :)

  • MellsMells Guru
    edited October 2013
    @ar2rsawseen
    I have been using giderosCodingEasy for long and almost forgot that the implementation is not native, which is also why i didn't make the connection with the other discussion.

    So giderosCodingEasy is making a choice on how to handle because there is not a single way to interpret how anchor points should be applied.

    I had already moved to the same solution as yours but wanted to be sure about that "issue". Sorry for not seeing the obvious, i really forgot that giderosCodingEasy is acting in the background :)

    I feel I ask rather strange questions these days. I must be disconnected.
    twitter@TheWindApps Artful applications : The Wind Forest. #art #japan #apps
Sign In or Register to comment.