How to remove the gradient effect from the gauges?

Ticomanel

Villager
Member
Joined
Jul 3, 2020
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMMV
So im trying to do a 8 bit style game and i want to get rid of the gradient effect given to gauges. Any idea how i can change that?
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
526
Reaction score
230
First Language
English
Primarily Uses
RMMV
You should be able to get that effect by changing this function in rpg_windows.js:

JavaScript:
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
    var fillW = Math.floor(width * rate);
    var gaugeY = y + this.lineHeight() - 8;
    this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
    this.contents.gradientFillRect(x, gaugeY, fillW, 6, color1, color2);
};
to this:

JavaScript:
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
    var fillW = Math.floor(width * rate);
    var gaugeY = y + this.lineHeight() - 8;
    this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
    this.contents.fillRect(x, gaugeY, fillW, 6, color1);
};
You could also try replacing "color1" on the last line with "color2"; usually one will be a slightly brighter colour and the other a slightly darker colour.

EDIT: I just noticed you're the same person who asked for the Pretty Gauges plugin. This patch assumes that plugin is not enabled; however, there's very likely a similar way to do it with the plugin enabled if it provides other features you need.
 
Last edited:

Ticomanel

Villager
Member
Joined
Jul 3, 2020
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMMV
You should be able to get that effect by changing this function in rpg_windows.js:

JavaScript:
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
    var fillW = Math.floor(width * rate);
    var gaugeY = y + this.lineHeight() - 8;
    this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
    this.contents.gradientFillRect(x, gaugeY, fillW, 6, color1, color2);
};
to this:

JavaScript:
Window_Base.prototype.drawGauge = function(x, y, width, rate, color1, color2) {
    var fillW = Math.floor(width * rate);
    var gaugeY = y + this.lineHeight() - 8;
    this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
    this.contents.fillRect(x, gaugeY, fillW, 6, color1);
};
You could also try replacing "color1" on the last line with "color2"; usually one will be a slightly brighter colour and the other a slightly darker colour.

EDIT: I just noticed you're the same person who asked for the Pretty Gauges plugin. This patch assumes that plugin is not enabled; however, there's very likely a similar way to do it with the plugin enabled if it provides other features you need.
Yeah im using Pretty Gauges and in the JS script for the Pretty Gauges plugin the gradient command from what i can see is very different from the one used in the default script.
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
526
Reaction score
230
First Language
English
Primarily Uses
RMMV
Looks like the same basic idea can apply for PrettyGauges - in the drawGauge function, just change all instances of color 1 to color 2 (or color 2 to color 1), including the gauge back color and the outline color.
 

Ticomanel

Villager
Member
Joined
Jul 3, 2020
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMMV
Looks like the same basic idea can apply for PrettyGauges - in the drawGauge function, just change all instances of color 1 to color 2 (or color 2 to color 1), including the gauge back color and the outline color.
Hey thanks for the help! I was able to solve it by changing the color parameters in the plugin to the same color.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Ok i got the model New and I will develop a little more, I think my SV is not beautiful yet.
"I, Giorno Giovanna, have a dream". In all seriousness, spatial BGM feature is now complete for my audio plugin.
Stream will be live shortly with some game development followed by the return of the Interactive Text Adventure after a short hiatus! Feel free to drop by!
Lately, I've taken to smashing random nouns/verbs together as insults. It's sort of amusing how many people don't really know how to respond to that. You bottle shaker!
Would be nice to pick color code that is not exclusively for message event

Forum statistics

Threads
103,243
Messages
998,316
Members
134,734
Latest member
Avaross
Top