How to remove the gradient effect from the gauges?

Ticomanel

Villager
Member
Joined
Jul 3, 2020
Messages
16
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
523
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
16
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
523
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
16
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 Profile Posts

I present... MAGIC (in progress)

No vaccine till at least spring 2021. Have not seen our parents since Dec 2019. But at least we can phone each other. How is everyone else's situation?
:( ... sigh, having trouble knowing where to draw highlights. Novice pixel artist issues.

Forum statistics

Threads
102,972
Messages
996,418
Members
134,439
Latest member
KUTSHKY
Top