O'Reilly logo

Learn Pixi.js: Create Great Interactive Graphics for Games and the Web by Rex van der Spuy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 7

image

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required