Jump to content

update event for phaser sprite


selvam
 Share

Recommended Posts

Hi guys,

Here i need to contorl some sprite animation during it play, so onUpdate event is required here but that event not fired.

my code is:

var sprite2;

var animEvent;

sprite2 = mainGame.add.sprite(0,0, 'anim');

sprite2.animations.add('walk');

animEvent=sprite2.animations.add('walk');

animEvent.onComplete.add(onAnimComplete,this);

animEvent.onUpdate.add(onAnimUpdate,this);

animEvent.play(10,false);

Here onAnimComplete method working fine, but onAnimUpdate method not fired. so can anyone help me to handle onUpdate event for sprite animation.

 

Thanks,

Selvam

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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