lokhmakov Posted May 21, 2014 Share Posted May 21, 2014 Hello. I think drag sprite within scaled group does not work properly. Example: http://jsfiddle.net/YHj24/23/ Drag work well when I scale sprite, but within scaled group - nope. What to do? ) Link to comment Share on other sites More sharing options...
Nick Posted May 21, 2014 Share Posted May 21, 2014 I've got around this in the past by adding the sprites directly to the game world. Then scaling the sprites using the scale of the group. It's not the perfect solution but it does stop the sprite from lagging behind the cursor when dragging. e.g. var myGroup = game.add.group(); myGroup.scale.setTo(0.5, 0.5); var sprite = app.game.add.sprite(0 , 0, 'sprite'); sprite.width = 100 * myGroup.scale.x; sprite.height = 100 * myGroup.scale.y; Link to comment Share on other sites More sharing options...
lokhmakov Posted May 31, 2014 Author Share Posted May 31, 2014 up Link to comment Share on other sites More sharing options...
alex_h Posted June 20, 2014 Share Posted June 20, 2014 Look at the 'getLocalPosition' method of the Input class, see this related topic: http://www.html5gamedevs.com/topic/6607-bug-drag-sprite-within-scaled-group/?hl=drag lokhmakov 1 Link to comment Share on other sites More sharing options...
lokhmakov Posted June 22, 2014 Author Share Posted June 22, 2014 Look at the 'getLocalPosition' method of the Input class, see this related topic: http://www.html5gamedevs.com/topic/6607-bug-drag-sprite-within-scaled-group/?hl=dragThanks. But u miss link to related topic Link to comment Share on other sites More sharing options...
alex_h Posted June 22, 2014 Share Posted June 22, 2014 Doh! You're right I linked to the wrong page Link to comment Share on other sites More sharing options...
Recommended Posts