Source: interaction/InteractionEvent.js

interaction/InteractionEvent.js

  1. /**
  2. * Event class that mimics native DOM events.
  3. *
  4. * @class
  5. * @memberof PIXI.interaction
  6. */
  7. export default class InteractionEvent
  8. {
  9. /**
  10. *
  11. */
  12. constructor()
  13. {
  14. /**
  15. * Whether this event will continue propagating in the tree
  16. *
  17. * @member {boolean}
  18. */
  19. this.stopped = false;
  20. /**
  21. * The object which caused this event to be dispatched.
  22. * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}.
  23. *
  24. * @member {PIXI.DisplayObject}
  25. */
  26. this.target = null;
  27. /**
  28. * The object whose event listener’s callback is currently being invoked.
  29. *
  30. * @member {PIXI.DisplayObject}
  31. */
  32. this.currentTarget = null;
  33. /**
  34. * Type of the event
  35. *
  36. * @member {string}
  37. */
  38. this.type = null;
  39. /**
  40. * InteractionData related to this event
  41. *
  42. * @member {PIXI.interaction.InteractionData}
  43. */
  44. this.data = null;
  45. }
  46. /**
  47. * Prevents event from reaching any objects other than the current object.
  48. *
  49. */
  50. stopPropagation()
  51. {
  52. this.stopped = true;
  53. }
  54. /**
  55. * Resets the event.
  56. */
  57. reset()
  58. {
  59. this.stopped = false;
  60. this.currentTarget = null;
  61. this.target = null;
  62. }
  63. }