# onInit

  • Property: onInit
  • Type: (sprite: RpgSprite) => any
  • Optional: true
  • Usage:

As soon as the sprite is initialized


# onDestroy

  • Property: onDestroy
  • Type: (sprite: RpgSprite) => any
  • Optional: true
  • Usage:

Called when the sprite is deleted


# onChanges

  • Property: onChanges
  • Type: (sprite: RpgSprite, data: any, old: any) => any
  • Optional: true
  • Usage:

As soon as a data is changed on the server side (the name for example), you are able to know the new data but also the old data.


# onUpdate

  • Property: onUpdate
  • Type: (sprite: RpgSprite, obj: any) => any
  • Optional: true
  • Usage:

At each tick, the method is called


# onMove

  • Since: 3.0.0-beta.4
  • Property: onMove
  • Type: (sprite: RpgSprite) => any
  • Optional: true
  • Usage:

When the x, y positions change