Mouse and Touch Events

You’ve learned how to add interactivity to sprites, using the keyboard, but most of your games and applications will use a mouse or touch interface. In this chapter, you’ll learn how to

  • Use a universal pointer object to interact with sprites
  • Work with mouse and touch events
  • Create a drag-and-drop interface
  • Create clickable, pressable buttons

And, as a bonus, at the end of this chapter, you’ll put all these skills together to make a complete game.

But first, let’s find out the basics you need to know to start using mouse and touch interactivity with Pixi.

Setting Up Tink

Pixi has a limited set of built-in tools ...

Get Learn Pixi.js: Create Great Interactive Graphics for Games and the Web now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.