0

So i am using a demo that pixi js made them self. http://pixijs.io/examples/#/demos/slots-demo.js

and i can't figure out or find anywhere on the web how i count a sprite as an example: https://i.stack.imgur.com/EunhC.png i want to count the ".add("required/assets/flowerTop.png","required/assets/flowerTop.png")" the green sprite one on the imgur link.

So if i spin him 2 times in the same reel i want to console.log him saying "FlowerTop: 2" something like that

gman
  • 100,619
  • 31
  • 269
  • 393
TehGaz7
  • 121
  • 2
  • 11

1 Answers1

1

the 'add' part you are referring to is just telling PIXI to load the image. What you need to do is actually assign the symbols to variables if you want to count them.

Take a look at rows 18 and 48 from the demo. This is how you are creating a texture and assigning it to a variable.

Then, when these variables are added on the screen(row 54), you can start counting how many times you have added the variable.

Ivan Dzhurov
  • 187
  • 6