Ricky Posted April 15, 2019 Share Posted April 15, 2019 Hi, i'm new on this forum and also new with pixijs I've started to implement a new slot game, all work fine but i have some problems implementing symbols animations. on stop spin, i'ma able to change symbols stopSpin: function(){ var offScreenCells = this.getOffScreenCells(); var easeType = Power1.easeOut; for(var i = 0; i < this.numRows; i++){ offScreenCells[i].updateSymbol(this.resultReel[i]); offScreenCells[i].stage.y = this.cellPosOriginal[i].y; TweenLite.to( this.spinTrickCells[i].stage, 0.5, { y: this.spinTrickCells[i].stage.y + (this.reelCellHeight * this.numRows), ease: easeType } ); // Tween onComplete callback to be added only to one Symbol. var callback = (i === this.numRows - 1) ? this.onSpinStop.bind(this) : null; TweenLite.to( this.cells[i].stage, 0.5, { y: this.cells[i].stage.y + (this.reelCellHeight * this.numRows), ease: easeType, onComplete: callback } ); } }, Here i'm getting symbol from frame ex. S1 updateSymbol: function(symbolID){ this.symbolID = symbolID; this.removeSymbol(); this.symbol = new PIXI.Sprite(PIXI.Texture.fromFrame(symbolID)); console.log(symbolID); this.stage.addChild(this.symbol); }, But i'm not able to implement this part of code updateSymbol: function(symbolID){ this.symbolID = symbolID; this.removeSymbol(); this.symbol = new PIXI.Sprite(PIXI.Texture.fromFrame(symbolID)); this.symbol = new PIXI.extras.AnimatedSprite("osiris"); this.symbol.animationSpeed = 0.100; // 6 fps this.symbol.scale.x=0.40; this.symbol.scale.y=0.40; this.symbol.play(); console.log(symbolID); this.stage.addChild(this.symbol); }, I'm getting always the same error: Uncaught TypeError: Cannot read property '_updateID' of undefined on Sprite.js Where is my mystake? Thanks Riccardo Quote Link to comment Share on other sites More sharing options...
Exca Posted April 16, 2019 Share Posted April 16, 2019 Animatedsprite requires a list of textures you wish to use. It should be something like this: var textures = [ PIXI.Texture.fromFrame("..."), ... ] this.symbol = new PIXI.AnimatedSprite( textures ); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.