denitz666 Posted August 3, 2015 Share Posted August 3, 2015 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 More sharing options...
Recommended Posts