[Vuejs]-Setting and Getting names from pixi Graphic

0👍

It looks like you’re using a single PIXI.Graphics object to represent all your buttons, which is not going to work how you expect. While you can draw multiple primitives into a Graphics object, they’ll all be treated as part of the same logical object. Meaning, when you set buttons.name = ‘foo’, that’s setting the name of the single PIXI.Graphics object, not the name of the primitives you’re drawing into it.

To fix this, change your code to have a single PIXI.Graphics object per button, and then your code will work as expected.

Leave a comment