FPS Counter

Hi there! I have a script already that displays the FPS on the screen in the upper left corner, but it is kind of obtrusive and it takes you out of the game.

Is there some way that I could include an FPS counter into the border? Like where the name is, or just a better way to display it.

Here is a link to the script that I am referring to:

It's by Zeus81

http://forums.rpgmakerweb.com/index.php?/topic/3738-fps-display-isnt-very-accurate/

I'd really appreciate it 🙂
What do you mean by "where the name is"?
You mean like what happens when you press F2? (This computer is bad)

x_178.png
It may be possible for scripts to access the window's title bar and change the title displayed accordingly.

I tried calling SetWindowText, but it doesn't stay.

module Window_Text SetWindowText = Win32API.new('user32', 'SetWindowText', 'pp', 'i') CreateWindowEx = Win32API.new('user32', 'CreateWindowEx', 'ippiiiiiiiii', 'i') FindWindow = Win32API.new('user32', 'FindWindow' , 'pp', 'i') HWND = FindWindow.call('RGSS Player', 0) def self.run SetWindowText.call(HWND, "test change") endendMy guess is that the RM player is also doing the same thing every frame when it calculates FPS.For example, adding this

module Graphics class << self alias :th_old_update :update def update th_old_update Window_Text.run end endendAnd you can see that the name changes to the custom text, but then it would change back to the old text.I don't know if there's anything you can do about it.
I'm confused here, doesn't F2 show the FPS? Why would you need another way?
Ah I didn't know that you could display the FPS with F2!

That was exactly what I was referring to.

Thanks for the speedy reply!

So is there a way to call the F2 command when the game starts so the player doesn't have to do it?

As you can see some people don't know about it lol 🤣
Dekita mentioned this on another topic:

(http://forums.rpgmakerweb.com/index.php?/topic/42595-fps/?p=420823)

Pressing F2 every playtest is extremely inconvenient (first world inconvenience)..

There is a script within this pack that automagically presses F2 for you at the start of game launch!!
Script Pack Link  (enter $0 on the 'puchase' page to get the system for free) 🙂

Theres also a number of other scripts for doing things... 😉
Thanks for putting in all the work Tsukihime

Spoiler
It may be possible for scripts to access the window's title bar and change the title displayed accordingly.
I tried calling SetWindowText, but it doesn't stay.
 

module Window_Text SetWindowText = Win32API.new('user32', 'SetWindowText', 'pp', 'i') CreateWindowEx = Win32API.new('user32', 'CreateWindowEx', 'ippiiiiiiiii', 'i') FindWindow = Win32API.new('user32', 'FindWindow' , 'pp', 'i') HWND = FindWindow.call('RGSS Player', 0) def self.run SetWindowText.call(HWND, "test change") endendMy guess is that the RM player is also doing the same thing every frame when it calculates FPS.

For example, adding this
 
Code:
module Graphics  class << self        alias :th_old_update :update    def update            th_old_update            Window_Text.run    end  endend
And you can see that the name changes to the custom text, but then it would change back to the old text.

I don't know if there's anything you can do about it.
And Jackus that is the exact script I was looking for!

Um...I don't know if it is against forum rules but I have another question because I am getting an error message when I paste the script "Dekita - FPS"

Spoiler
Script 'Dekita - FPS' line 50: NameError occured.

uninitialized constant Object:😀EK
Here is the line of script in question

Spoiler
Code:
#===============================================================================# ■ DEK::FPS#===============================================================================module DEK::FPS#===============================================================================  #-----------------------------------------------------------------------------  # ☆ DEK::FPS.toggle
 
Dont forget to add Dek Kore as well.
It is rather against forum rules because if we keep one question, one thread, it is much simpler for other people to find the solution if they have a similar problem.  That's one of the reasons we like people to give clear titles to their threads as well.

In this case, I strongly urge you to post your query in the thread of the script that is causing you problems.  You are much more likely to get an informed answer.
Thank you for the clarification! I'll check out Dek's script page and see if anyone else ran into the problem.

I really appreciate the help guys!

Edit: The Dekita Kore was all that was missing. Works Perfectly!...Cheers!

Original thread: https://forums.rpgmakerweb.com/threads/fps-counter.42661/