Jump to content

Phaser 3 animation speed (frameRate, timeScale) limitation


Anton Kukhar
 Share

Recommended Posts

I wrote very small test app for animation speed and faced a problem. Seems that animation fps is limited by 60 fps...

App code here:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Bigger Than</title>
    <script src="phaser-3-15.js"></script>
</head>
<body>
    <script type="text/javascript">
       var config = {
          type: Phaser.AUTO,
          parent: 'phaser-example',
          width: 800,
          height: 600,
          scene: {
             preload: preload,
             create: create
          }
       };

       var game = new Phaser.Game(config);

       function preload ()
       {
           this.load.atlas('rotation', 'rotation.png', 'rotation.json');
       }

       function create ()
       {
	       var framesNames = this.anims.generateFrameNames('rotation', { prefix: 'rotation_', end: 35, zeroPad: 4 });
           this.anims.create({ key: 'rotation', frames: framesNames, repeat: -1, frameRate: framesNames.length });

          var spr = this.add.sprite(400, 400, 'rotation').play('rotation');
          spr.anims.setTimeScale(4);
       }

    </script>
</body>
</html>

time scale values 2 and 4 has no difference...

How can I increase animation speed?

Thanks for your replies!

rotation.json

rotation.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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