Jump to content

game.time.fps


XekeDeath
 Share

Recommended Posts

There is only one place that I reference the fps variable in the entire code base:

//First line in the GUI class update function.this.fps.setText("FPS: " + this.game.time.fps);

This used to work fine, so I am wondering if Rich changed something in the back end that I missed and did not adjust for.

 

The only other place I reference game.time is here:        

//Create function of the main game state...this.game.time.events.loop(Phaser.Timer.SECOND, this.timeMinute, this);this.game.time.events.loop(Phaser.Timer.SECOND*15, this.timeQuarterHour, this);this.game.time.events.loop(Phaser.Timer.SECOND*30, this.timeHalfHour, this);this.game.time.events.loop(Phaser.Timer.MINUTE, this.timeHour, this);        

And those timers now work perfectly, no more psycho timers.

Link to comment
Share on other sites

Always always read the README when doing a fresh pull! Specifically the Significant API changes section :)

 

But here's the bit you need:

* Time.advancedTiming is a new boolean property. If true Time.fps, fpsMin, fpsMax, frames, msMin and msMax will be calculated, otherwise they remain at their defaults.
Link to comment
Share on other sites

But reading readmes takes precious seconds out of my day! I could be watching streams, playing games, or making forums posts asking for answers that are contained within the readme with those seconds!

Also, I'm using the GitHub desktop app thingy that doesn't show me the readme in its entirety. Silly program. Guess I'll stop being lazy and either open the github page, or look through the commits each morning, which is probably a good idea anyway...

 

 

Thanks Rich.

Link to comment
Share on other sites

  • 7 months later...

For those of us who are easily confused, the correct usage is:

 

1) game.time.advancedTiming = true (for example, in your state's create)

2) game.time.fps returns the current FPS (after the first 1s of your game). You can draw it in your state's update method.

Link to comment
Share on other sites

do you plan to give us even more information in phaser-debug?   i'd really like to have an easy way to find out what functions cause the peaks in the graph...

 

If only there was some way for people to put in feature requests so I know what they want....hmmm...

 

Also the functions causing the graph peaks are in the left hand side. If you need more specific data than that you should use chrome profiling tools.

Link to comment
Share on other sites

  • 7 months later...
 Share

  • Recently Browsing   0 members

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