Jump to content

Tweens duration different on different machines


esotery
 Share

Recommended Posts

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;            }        }

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...