Customizing fpsmeter.js

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?
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();
};
@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?
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)"
    }
};
Yeah thanks, but what about the FPS goes to ms error?
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?
uh nope. in the default rpg_core settings, the toggle is click.


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

Original thread: https://forums.rpgmakerweb.com/threads/customizing-fpsmeter-js.68783/