Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Add object to group, keep original scale


Arcanorum
 Share

Recommended Posts

I am currently adding a sprite to my game with no texture as I just need an invisible draggable area, resizing it to the dimensions I need, then adding a bunch of buttons to it with .addChild(button) so that the buttons follow the sprite when dragged, which works fine, but the buttons adopt the scale of the sprite, which is undesired in this case.

How can I reset the scale of a child after it has been added to a group?

Link to comment
Share on other sites

Thanks, that works well enough. It does feel a bit hacky. I'm running into some other issues due to the parent scale. I'm trying to do some precise positioning of the buttons, but lets say I reposition the button along by 1 pixel, it will be 1*parent scale, making it move way further than it should.

What I really need is a way to either ignore all parent transforms when the child is added, or find a way to make the buttons move with the draggable sprite without using groups.

I'm kind of surprised I could find no topics of other people having this problem.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...