Customizing fpsmeter.js

gmestanley

An Ordinary Wizard
Veteran
Joined
Oct 30, 2015
Messages
66
Reaction score
21
First Language
Portuguese
Primarily Uses
So, RPG Maker now has a plugin that adds a FPS meter, which is kind of great since games from nowadays use fps meters to show how fast or slow they are running.


However, I want to customize this plugin to make it my way, adding a second number (for example: 60 FPS would become 60.00 FPS) so it would look like the FPS Meter of Touhou. I would also like to make it more lively so it doesn't uses the plain boring dark theme. Eventually, I found out that it is possible to make this, by altering the .js file of the plugin. However, the alterations I made ("theme = colorful" for the more lively design and "decimals = 2" for the second number) did not show in-game for some reason. Can anyone help me plz?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
You will need to overwrite or otherwise change the default settings MV assigns to the FPS Meter :

Code:
// * rpg_core (v1.3.1)
// * line 2121 ~ 2125
Graphics._createFPSMeter = function() {
    var options = { graph: 1, decimals: 0, theme: 'transparent', toggleOn: null };
    this._fpsMeter = new FPSMeter(options);
    this._fpsMeter.hide();
};
 

gmestanley

An Ordinary Wizard
Veteran
Joined
Oct 30, 2015
Messages
66
Reaction score
21
First Language
Portuguese
Primarily Uses
@Exhydra Thanks a lot m8! You helped me so much.


Now I just need to adjust the size of the FPS Meter tab. Do you know if I can do it directly on the fpsmeter.js file or do I need to alter the rpg_core.js file too?


EDIT: For some reason, after applying the values "colorful" and "2" to the string "theme" and the integer "decimals", when I press F2 to close the FPS meter, it won't close and it displays in ms instead. why does it happens?
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
You will need to edit the colorful theme to change the minimum width. Once you increase the width, you may also have to tinker with the amount of graph columns and so on.

Code:
FPSMeter.theme.colorful = {
    heatmaps: [
        {
            saturation: 0.5,
            lightness: 0.6
        }
    ],
    container: {
        // Settings
        heatOn: "backgroundColor",

        // Styles
        padding: "5px",
        minWidth: "95px",
        height: "30px",
        lineHeight: "30px",
        textAlign: "right",
        background: "#aaa",
        border: "1px solid #ccc",
        borderColor: "rgba(0,0,0,0.1)",
        color: "#fff",
        textShadow: "1px 1px 0 rgba(0,0,0,.2)"
    },
    count: {
        // Styles
        position: "absolute",
        top: 0,
        right: 0,
        padding: "5px 10px",
        height: "30px",
        fontSize: "24px",
        fontFamily: "Consolas, Andale Mono, monospace",
        zIndex: 2
    },
    legend: {
        // Styles
        position: "absolute",
        top: 0,
        left: 0,
        padding: "5px 10px",
        height: "30px",
        fontSize: "12px",
        lineHeight: "32px",
        fontFamily: "sans-serif",
        textAlign: "left",
        float: "left",
        zIndex: 2
    },
    graph: {
        // Styles
        position: "relative",
        boxSizing: "padding-box",
        MozBoxSizing: "padding-box",
        height: "100%",
        zIndex: 1
    },
    column: {
        // Settings
        width: 4,
        spacing: 1,

        // Styles
        background: "#777",
        backgroundColor: "rgba(0,0,0,.2)"
    }
};
 

gmestanley

An Ordinary Wizard
Veteran
Joined
Oct 30, 2015
Messages
66
Reaction score
21
First Language
Portuguese
Primarily Uses
Yeah thanks, but what about the FPS goes to ms error?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Hmm ... that does not happen on my test project. Perhaps you edited another piece of code that is now interfering with the FPS Meter toggle?
 

gmestanley

An Ordinary Wizard
Veteran
Joined
Oct 30, 2015
Messages
66
Reaction score
21
First Language
Portuguese
Primarily Uses
uh nope. in the default rpg_core settings, the toggle is click.


i'll see if this happens on mah test project.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top