esotery Posted October 29, 2015 Share Posted October 29, 2015 Hello guys and girls, I am trying to get my head around one problem I am noticing when using Phaser's tweening mechanism. I've create a simple effect to highlight text which I wan't to be clicked on. The thing is, that the tweens (scale up and scale back) run at different speed on different machines. On table PC or laptop, the animation is shorter than on mobile devices meaning the tween takes less time to complete. Am I doing something wrong here? Is it a "feature"? I mean if I tell the framework that a tween should last 1000ms, it should last 1000ms no matter the CPU speed. FYI, I am using Phaser.AUTO for the renderer in the game constructor. BTW, I am experiencing this issue also in standard examples from examples library (like tweens > bounce). Thank you very much. this.Effects = { pulsateText: function(text, pulsDuration) { var self = { scaleUp: _game.add.tween(text), scaleBack: _game.add.tween(text) }; self.scaleUp.to({ fontSize: text._baseFontSize + 10 }, pulsDuration, Phaser.Easing.Linear.None, true); self.scaleUp.onStart.add(function() { self.delay = 0; }, this); self.scaleUp.chain(self.scaleBack); self.scaleBack.to({ fontSize: text._baseFontSize }, pulsDuration, Phaser.Easing.Linear.None, true); self.scaleUp.onStart.add(function() { self.delay = 0; }, this); self.scaleBack.chain(self.scaleUp); self.scaleUp.start(); return self; } } Tilde 1 Link to comment Share on other sites More sharing options...
esotery Posted October 29, 2015 Author Share Posted October 29, 2015 Found it already, don't know why but it seems you have to use game.tweens.framebased = true;Even though it should be (IMHO) the other way around:). Tilde 1 Link to comment Share on other sites More sharing options...
mariogarranz Posted October 29, 2015 Share Posted October 29, 2015 I also opened a topic about the exact same thing with your exact same conclusions:http://www.html5gamedevs.com/topic/18183-tweenmanagerframebased-not-working-as-expected/ Link to comment Share on other sites More sharing options...
esotery Posted October 29, 2015 Author Share Posted October 29, 2015 Mario, actually I found the answer in your thread, sorry for not giving you credit rightaway:-). Link to comment Share on other sites More sharing options...
Recommended Posts