It is currently June 20th, 2019, 6:01 pm

Working with Roundline

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
jsmorley
Developer
Posts: 19266
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with Roundline

jsmorley » May 16th, 2015, 12:55 pm

moshi wrote: to get this to work on the other edges you'll need to define an image as Background in the [Rainmeter] section of a skin.
Ah, right. There we go...

Code: Select all

[Rainmeter]
Update=50
AccurateText=1
BackgroundMode=0
Background=#@#Images\100x100.png
LeftMouseUpAction=[!ShowMeter MeterCircle][!EnableMeasure MeasureLoop][!CommandMeasure MeasureLoop "Reset"]

[MeasureLoop]
Measure=Loop
StartValue=-50
EndValue=150
Increment=5
LoopCount=1
Disabled=1

[MeasureCalc]
Measure=Calc
Formula=1

[MeterCircle]
Meter=Roundline
MeasureName=MeasureCalc
StartAngle=(Rad(360))
RotationAngle=(Rad(360))
X=[MeasureLoop]
Y=[MeasureLoop]
LineLength=50
LineColor=235,245,255,255
SolidColor=0,0,0,1
Solid=1
AntiAlias=1
DynamicVariables=1
Hidden=1
test.gif
Now I can finally finish that Rainmeter Pacman game... ;-)
You do not have the required permissions to view the files attached to this post.
setsuna
Posts: 9
Joined: May 28th, 2015, 1:56 am

Re: Working with Roundline

setsuna » May 28th, 2015, 2:23 pm

Hi guys,

I was wondering if its possible to make a roundline that corresponds with your Power % and decrease accordingly? :confused:
User avatar
jsmorley
Developer
Posts: 19266
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with Roundline

jsmorley » May 28th, 2015, 3:31 pm

setsuna wrote:Hi guys,

I was wondering if its possible to make a roundline that corresponds with your Power % and decrease accordingly? :confused:
Sure. If you use the example in my first post, you can just replace:

[MeasureCounter]
Measure=Calc
Formula=(MeasureCounter % 100) + 1
MinValue=1
MaxValue=100

With your Power measure.

[MeasureBatteryPercent]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent
MinValue=0
MaxValue=100

It is still a percentage from 0-100%, so it will work fine.
setsuna
Posts: 9
Joined: May 28th, 2015, 1:56 am

Re: Working with Roundline

setsuna » May 28th, 2015, 10:39 pm

:thumbup:
Awesome!

Sorry I'm a total noob at this, but how do I get it to display the actual power percentage and have the line in the circle shift accordingly?

I also tried changing the size of the circle by changing the H and W values but it still stayed the same.
User avatar
jsmorley
Developer
Posts: 19266
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with Roundline

jsmorley » May 28th, 2015, 10:51 pm

setsuna wrote::thumbup:
Awesome!

Sorry I'm a total noob at this, but how do I get it to display the actual power percentage and have the line in the circle shift accordingly?

I also tried changing the size of the circle by changing the H and W values but it still stayed the same.
You will use a String meter to display the percentage as text, and the size of the Roundline inside the meter defined by W and H is done with LineStart and LineLength.
setsuna
Posts: 9
Joined: May 28th, 2015, 1:56 am

Re: Working with Roundline

setsuna » May 28th, 2015, 11:33 pm

I see,

The LineStart and LineLenght has been changed but they seem to be restrained within a border which I can no locate to increase the dimensions?

Also, the power meter does not seem to be correlating with the actual power level?

Here is what I have:

Code: Select all

[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1

[MeasureBatteryPercent]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent
MinValue=0
MaxValue=100

[MeterBackgroundPie]
Meter=Roundline
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineLength=25
LineColor=150,150,150,255
Solid=1
AntiAlias=1

[MeterBackgroundCircle]
Meter=Roundline
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=50
LineLength=60
LineColor=150,150,150,255
Solid=1
AntiAlias=1

[MeterPie]
Meter=Roundline
MeasureName=MeasureCounter
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineLength=25
LineColor=175,247,151,255
Solid=1
AntiAlias=1

[MeterCircle]
Meter=Roundline
MeasureName=MeasureCounter
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=30
LineLength=40
LineColor=173,220,247,255
Solid=1
AntiAlias=1

[MeterPointer]
Meter=Roundline
MeasureName=MeasureCounter
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=3
LineLength=40
LineColor=217,54,54,255
AntiAlias=1

[MeterText]
Meter=String
MeasureName=MeasureCounter
FontSize=13
FontColor=255,255,255,255
X=80
Y=85
StringAlign=Right
AntiAlias=1
Text=100%
User avatar
jsmorley
Developer
Posts: 19266
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with Roundline

jsmorley » May 28th, 2015, 11:37 pm

setsuna wrote:I see,

The LineStart and LineLenght has been changed but they seem to be restrained within a border which I can no locate to increase the dimensions?

Also, the power meter does not seem to be correlating with the actual power level?

Here is what I have:

Code: Select all

[Rainmeter]
Update=100
AccurateText=1
DynamicWindowSize=1

[MeasureBatteryPercent]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent
MinValue=0
MaxValue=100

[MeterBackgroundPie]
Meter=Roundline
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineLength=25
LineColor=150,150,150,255
Solid=1
AntiAlias=1

[MeterBackgroundCircle]
Meter=Roundline
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=50
LineLength=60
LineColor=150,150,150,255
Solid=1
AntiAlias=1

[MeterPie]
Meter=Roundline
MeasureName=MeasureCounter
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineLength=25
LineColor=175,247,151,255
Solid=1
AntiAlias=1

[MeterCircle]
Meter=Roundline
MeasureName=MeasureCounter
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=30
LineLength=40
LineColor=173,220,247,255
Solid=1
AntiAlias=1

[MeterPointer]
Meter=Roundline
MeasureName=MeasureCounter
W=80
H=80
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineWidth=3
LineLength=40
LineColor=217,54,54,255
AntiAlias=1

[MeterText]
Meter=String
MeasureName=MeasureCounter
FontSize=13
FontColor=255,255,255,255
X=80
Y=85
StringAlign=Right
AntiAlias=1
Text=100%
You are going to want to use MeasureName=MeasureBatteryPercent and not MeasureName=MeasureCounter in all the meters that need to be "bound" to a measure right? Aren't you trying to display the value of MeasureBatteryPercent?
setsuna
Posts: 9
Joined: May 28th, 2015, 1:56 am

Re: Working with Roundline

setsuna » May 28th, 2015, 11:40 pm

ah yes... silly me... thank you!

what about the rectangular border restriction on the circle itself?
User avatar
jsmorley
Developer
Posts: 19266
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with Roundline

jsmorley » May 28th, 2015, 11:44 pm

The way it works as far as size is:

- The overall meter is defined by W and H.
- The Roundline is drawn using the "center" of the meter as the origin
- So if a meter is W=120 and H=120 then the "center" is at W=60 and H=60
- The LineStart and LineLength value are then calculated from that "center"

So:

W=120
H=120
LineStart=50
LineLength=60

That will create a circle that is 120 X 120, the line will be drawn starting at 50 pixels from the center, and extending to 60 pixels from the center. So that will be a line in the last 10 pixels of the overall circle.
User avatar
jsmorley
Developer
Posts: 19266
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with Roundline

jsmorley » May 28th, 2015, 11:49 pm

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureBatteryPercent]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent
MinValue=0
MaxValue=100

[MeterBackgroundCircle]
Meter=Roundline
W=120
H=120
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=50
LineLength=60
LineColor=150,150,150,255
Solid=1
AntiAlias=1

[MeterCircle]
Meter=Roundline
MeasureName=MeasureBatteryPercent
W=120
H=120
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineStart=50
LineLength=60
LineColor=173,220,247,255
Solid=1
AntiAlias=1

[MeterText]
Meter=String
MeasureName=MeasureBatteryPercent
FontSize=13
FontColor=255,255,255,255
X=80
Y=85
StringAlign=Right
AntiAlias=1
Text=%1%
test.gif
You do not have the required permissions to view the files attached to this post.