Arcanorum Posted July 23, 2016 Share Posted July 23, 2016 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 More sharing options...
TickleMeElmo Posted July 24, 2016 Share Posted July 24, 2016 theres probably some better method but one way is to do this: child.scale.setTo(desiredScale / parent.scale) Link to comment Share on other sites More sharing options...
Arcanorum Posted July 24, 2016 Author Share Posted July 24, 2016 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 More sharing options...
LTNGames Posted July 25, 2016 Share Posted July 25, 2016 I use groups for all my windows in my game which is just a group of buttons, text and what not. I found lewster32 has an excellent workaround for the group scaling and I use it in my project. It should be what your looking for. Find it here http://jsfiddle.net/lewster32/skhsbkk4/ Link to comment Share on other sites More sharing options...
Recommended Posts