How to remove the gradient effect from the gauges?

Ticomanel

Villager
Member
Joined
Jul 3, 2020
Messages
10
Reaction score
0
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
493
Reaction score
216
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
10
Reaction score
0
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
493
Reaction score
216
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
10
Reaction score
0
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

And back. Trying to work online with no internet for 1.5 days was...interesting. I felt like a character in a old Sierra game trying to find internet due to all the hoops I had to jump through just to get online for work.
grief... if MV didn't have certain plugins already, I think I'd upgrade to MZ. seeing like 10 MV plugins in 1 MZ one is hilariously convenient lol.
Have you already checkes out my mapping tutorial on the blog? I would love to hear your feedback and things you'd like to see in the future!

one of character for my upcoming game idk how to design o_O

Designing patches that can 'augmented' to clothing based armor. Such good fun. A bit time consuming due to the need to create image displays, but the patches are limited so it's not too tiring.
Note: lol, posting this made me find a couple mistakes.

Forum statistics

Threads
100,737
Messages
978,947
Members
132,359
Latest member
PhilKeepItReal
Top