Jump to content

Tweens duration different on different machines


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

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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