Page 1 of 1

Hello, you wonderful people!

Posted: March 12th, 2017, 4:33 pm
by andy99000
Hello! I am new to writing code for rainmeter. It is really cool! (I more than likely won't be creative enough to do half the things you guys do though)

Quick Question,

I am making my own skin suite. I got the clock done (it looks very nice, in my opinion), and now I am working on a resource monitor. I have a bar meter that never updates, although I have it connected to the CPU measure. What did I do wrong?

Code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,255

[Metadata]
Name=My First Skin
Author=Andy99000
Information=This is my first resource monitor
Version=1.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
fontName=consola
fontSize=50
white=255,255,255,255
Green=0,255,0,255
Red=255,0,0,255

[measureCPU]
Measure=CPU

[MeterCPULabel]
Meter=String
MeasureName=measureCPU
FontSize=#fontSize#
FontColor=#white#
AntiAlias=1
Text=CPU

[MeterCPUBar]
MeasureName=measureCPU
Meter=Bar
Y=0R
W=165
H=10
BarColor=0,0,0,0
SolidColor=#Green#
SolidColor2=#Red#
Your help is greatly appreciated!

Re: Hello, you wonderful people!

Posted: March 12th, 2017, 4:56 pm
by jsmorley
Welcome aboard...

I think maybe you misunderstand what SolidColor / SolidColor2 do. they set the color of the overall meter container. So you have a constant W and H for the bar meter, that is always just set to that gradient from green to red. Then you have a BarColor that is entirely invisible, no matter what the measured value is, since you have BarColor=0,0,0,0. that last "0" is the "alpha" value, and a value of zero is entirely invisible.

If what you want is a gradient from green to red to be used as the color of the bar as the value changes, you will need to use an image for the bar, as explained here:

https://forum.rainmeter.net/viewtopic.php?f=118&t=16758

Be be aware that with a "vertical" bar meter, with a height that is only "10", you are not going to see much unless the CPU really spikes above 30-40% or so. You might have meant to put BarOrientation=Horizontal on that meter...

You could use an image like this if you want it horizontal:
165x10Grad.png

Re: Hello, you wonderful people!

Posted: March 12th, 2017, 5:53 pm
by andy99000
I guess I did misunderstand the solid colors thing, and I totally didn't even think about the alpha being 0. Your solution worked, thanks! :thumbup:

Re: Hello, you wonderful people!

Posted: March 12th, 2017, 8:29 pm
by jsmorley
andy99000 wrote:I guess I did misunderstand the solid colors thing, and I totally didn't even think about the alpha being 0. Your solution worked, thanks! :thumbup:
Glad to help, and welcome again.