Jump to content

Search the Community

Showing results for tags 'onComplete'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 12 results

  1. Hi, I'm having a problem (it looks like a bug) with phaser.signal detecting when a video has ended when using changeSource function. I'm using phaser 2.4.8 (but it also happened with 2.4.6). To reproduce the issue, please change both videos and the image button with some media you have. Once you run the demo, check your developer console each time button is pressed. The first time the video is stopped, it says "Played 1 times" The second time it says "Played 2 times" AND "Played 3 times" The third time it says "Played 4 times", "Played 5 times" AND "Played 6 t
  2. I have been trying to set up a chain of tweens for hours, without results. This is what I want to accomplish: Target is a group, located above the world Tween 1 Arrive: group comes down into x:48, y:96, then Tween 2 Swing: group starts moving back and forth (yoyo) between initial x value and given x value. Tween 3 Creep: In Tween2's onLoop.add a tween is called to move the group in y axis When stage ends, the group must go back its initial position, and its children sprites recreated, so in a restart function I stop Swing tween and to its onComplete add: Tween 4 G
  3. I see that there is an onComplete method on the Animations but I can't figure out how to use it. I want to run a function everytime an animation has been completed. Can someone explain how this can be done, my way of doing it now has me watching for the isFinished property to equal true, but this seems like the wrong way to do it.
  4. icp

    2.4.2 loadTexture

    I'm using a tween that changes the texture of a Sprite when onComplete method gets called. Sometimes it fails to change the texture via this.sprite.loadTexture('myTexture'); . Everything works fine with Phaser 2.3 .
  5. Hi, I was looking at the chained tweens example and I tryed to add an onCompete event at the end of the tween but it's look like the event is dispatched after the end of the first tween. var tween = this.game.add.tween(this.phaser).to({ alpha: 1 }, 1000, Phaser.Easing.Sinusoidal.InOut, true).to({ alpha: 0 }, 1000, Phaser.Easing.Sinusoidal.InOut, false, 1000).onComplete.add(this.onAnimationDone, this);I found this solution on the forum wich is not ellegant, but at least functional: var tween = this.game.add.tween(this.phaser).to({ alpha: 1 }, 1000, Phaser.Easing.Sinusoidal.InOut).to({ alpha:
  6. Anybody ever have this problem before?, In this code: while (killedSprites.length > 0) { var sprite = killedSprites.shift(); var tween = game.add.tween(sprite); tween.to({ alpha: 0 }, 100, Phaser.Easing.Linear.None); tween.onComplete.add(function () { sprite.destroy(); }); tween.start();}Why is it that when killedSprite has more than 1 sprites, only the first sprite gets detroyed even if the tweens are all run and complete.
  7. Hello ! I have a quite simple problem (Phaser 2.0.2). On a custom Sprite with an animation, I call sprite.Destroy() when the animation is complete but then it throws me "TypeError: this.currentAnim is null" (line 37562). Here's my code: SpecialFX = function(_x, _y, _spriteName) { Phaser.Sprite.call(this, game, _x, _y, _spriteName); this.animIdle = this.animations.add('idle', [0, 1, 2, 3, 4], 10, false); this.animIdle.onComplete.add(this.animationStopped, this); this.animations.play('idle'); game.add.existing(this);};SpecialFX.prototype = Object.create(Phaser.Sprite.prototype
  8. Hi, I would like to know what's the best way to trigger my function with chained tweens. The following code doesn't really work. The function which contains the "alert" is triggered when the first tween completes. var jumpTween = game.add.tween(playState.player); jumpTween.to({ y: 70 }, 200); ju empTween.to({ y: 150}, 400); jumpTween.onComplete.add(function(){console.log("CIAO");}, this); <--- This is triggered when y=70. jumpTween.start(); Is there any elegant solution which doesn't involves combined tweens? (http://examples.phaser.io/_site/view_full.html?d=
  9. Here are my animations baddie.animations.add('fly',[0,1],5,true);baddie.animations.add('hit',[2,0,2],10,false);baddie.animations.play('fly');When the baddie is hit: baddie.animations.play('hit');It plays the hit animation once, then stays on the last frame. Is there a way I can get it to fire an event, or process a function after the animation is done? I can see there is a killOnComplete option, but no onComplete function option. The only real way I can see this working is having a timer or counter, then going back to the fly animation, but that's a bit sloppy and could get annoying with m
  10. Hi PandaJS, I'm trying to add an onComplete() function to a tween. This is what I have so far: var tween = new game.Tween(sprite) .to({x:100, y:100}, 1000) .easing(game.Tween.Easing.Back.Out);tween.start();Do you know how I add an onComplete function? Thanks a lot!
  11. Hello guys, Im not sure if it is a pixi-bug or my own code but maybe you can evaluate this better than me I created a MovieClip with an onComplete callback to remove itself. Works fine, but as soon as there are more MovieClips, pixi throws an error: Uncaught TypeError: Cannot call method 'updateTransform' of undefined pixi.js:3126 PIXI.Stage.updateTransform pixi.js:3126 PIXI.WebGLRenderer.render pixi.js:4460 animate (index):24 Looks like that the MovieClip is removed and pixi still wants to call updateTransform. The easy way is to put tons of if(indexOf(mc) != -1)'s to the compiled pi
  12. With this code: tempBrick.animations.add('idle', ['brick_' + bID + '_1.png'], 10, false, false); tempBrick.animations.add('brick_die', [ 'brick_' + bID + '_1.png', 'brick_' + bID + '_2.png', 'brick_' + bID + '_3.png', 'brick_' + bID + '_4.png' ], 10, false, false); tempBrick.animations.add('brick_popin', [ 'brick_' + bID + '_4.png', 'brick_' + bID + '_3.png', 'brick_' + bID + '_2.png', 'brick_' + bID +
  • Create New...