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
488
Reaction score
212
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
488
Reaction score
212
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 Profile Posts

So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:

Forum statistics

Threads
100,652
Messages
978,095
Members
132,261
Latest member
DarthNinjus
Top