Jump to content

drag sprite from another sprite


denitz666
 Share

Recommended Posts

Hey there,

 

 I'am trying to move a sprite while doing a click/drag motion on another. Basically I'd like to make an area to click/drag and another sprite to move correspondingly.

 

I already tried to implement the click/drag area by locking drag directions but unfortunately i can't start the drag process on the other sprite manually.

 this.player = this.game.add.sprite(150, 150, 'player');this.player.inputEnabled = true;      this.player.input.enableDrag(false, false, false, false,        new Phaser.Rectangle(0,0, this.game.world.width, this.game.world.height));      this.player.input.allowVerticalDrag = false;var dragSpace.inputEnabled = true; dragSpace.input.enableDrag(); dragSpace.input.setDragLock(false, false); dragSpace.events.onDragStart.add(function (pointer) { this.player.input.startDrag(pointer); }, this);

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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