CHAPTER 3

image

Shapes, Text, and Groups

So far in this book, all the sprites we’ve used have been based on existing images that we loaded into our programs. But Pixi also has its own low-level drawing tools that you can use to make shapes, lines, and text. To help keep things organized, you can group all your shapes and images together, so that you can work with them as a single unit. In this chapter, you’re going to learn how to do all that, including:

  • Making rectangles, circles, lines, ellipses, and polygons
  • Creating text
  • Grouping sprites

All the sample code in this chapter is meant to be run inside the setup function of the basic Pixi application ...

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

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