Jump to content

Play sprite frames when mouse hold and move

Junaid Rao

Recommended Posts


i am new to phaser and js, i run into a problem when building a test game , the scenario is this


i have a sprite with animation in it

game.load.atlasXML('lefteye', 'images/Sprites/left_eye.png', 'images/Sprites/left_eye.xml');leftEye = game.add.sprite(22, 60, 'lefteye', 'Left eye0000');leftEye.anchor.setTo(0,0);

I want to play frame one by one when user click and drag mouse on the sprite, i tired 

game.input.addMoveCallback(diffX, this);

but it give me access to the click object properties


i tried like this

var item = pointer.targetObject;console.log("ClientX\t"+item+"\t x   "+x+"   y   "+y+"   isDown   "+isDown);

is it possible to change frame of sprite when move hold and move in phaser or not


any kind of help is much appreciated,


Thanks in advance



Link to comment
Share on other sites


  • Recently Browsing   0 members

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