Jump to content

[BUG] Drag sprite within scaled group


lokhmakov
 Share

Recommended Posts

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

  • 2 weeks later...
  • 3 weeks later...
 Share

  • Recently Browsing   0 members

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