It is currently April 13th, 2021, 10:18 am

Help with creating, editing & fixing problems with skins

BlueJive
Posts: 25 Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy
Post
by BlueJive » April 2nd, 2021, 12:34 pm

Hey all

I'm trying to code a skin that has arcs with curved ends, like this:

Now, I know that roundline meters and arcs can't do this. So I'd need to use a path shape. However, my difficulty lies in, 1: getting a path shape to look like an arc, and 2: editing the end points of the shape to be variables so that they can be used for system monitoring plugins.

Here's what I've got so far:

Code: Select all

```
[MeterShape]
Meter=Shape
X=700
Y=15R
Shape=Path MyPath | StrokeWidth 8 | Stroke Color 173,220,247,255 | Fill Color 87,149,212,0
MyPath=0,0 | ArcTo 200,200 | CurveTo 0,0,100,100
```

Not much

I would really appreciate some help with this (preferably explaining in slightly more detail about path shapes, I'd like to learn how to code these skins with less external help in the future) and I hope you don't mind me putting this here, rather than in the shape megathread, since this lies slightly outside of that specification.

Thanks so much

Last edited by BlueJive on April 8th, 2021, 10:48 am, edited 1 time in total.

CyberTheWorm
Posts: 766 Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada
Post
by CyberTheWorm » April 2nd, 2021, 5:42 pm

BlueJive wrote: β April 2nd, 2021, 12:34 pm
Hey all

I'm trying to code a skin that has arcs with curved ends, like this:

Now, I know that roundline meters and arcs can't do this. So I'd need to use a path shape. However, my difficulty lies in, 1: getting a path shape to look like an arc, and 2: editing the end points of the shape to be variables so that they can be used for system monitoring plugins.

Actually you can use Roundline.

2021-04-02_10h38_31.png

Here is the code I used, I'm sure you could edit this and get what you want.

Code: Select all

```
[Rainmeter]
Update=1000
[Metadata]
Author=CyberTheWorm
Version=1.0.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Circle CPU Monitor
;-------------------- Variables ----------------------
[Variables]
Blue=126,217,241,255
LightBlue=126,217,241,100
BlueBackground=69,150,221,255
MyFont=Arial
;-------------------- Measures ----------------------
[MeasureAverageCPU]
Measure=CPU
[MeasureCore0]
Measure=CPU
Processor=0
[MeasureCore1]
Measure=CPU
Processor=1
[MeasureCore2]
Measure=CPU
Processor=2
[MeasureCore3]
Measure=CPU
Processor=3
;-------------------- Meters ----------------------
;Transparent background to enable click anywhere on meter
[MeterBackground]
Meter=Roundline
X=0
Y=0
H=120
W=120
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineLength=60
LineColor=0,0,0,1
Solid=1
AntiAlias=1
[MeterAverageCPUBackground]
Meter=Roundline
X=0
Y=0
H=120
W=120
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineLength=60
LineStart=50
LineColor=#LightBlue#
Solid=1
AntiAlias=1
[MeterAverageCPU]
Meter=Roundline
MeasureName=MeasureAverageCPU
X=30
Y=30
H=60
W=60
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineLength=60
LineStart=50
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreBackground]
Meter=Roundline
X=30
Y=30
H=60
W=60
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineLength=49
LineStart=39
LineColor=#LightBlue#
Solid=1
AntiAlias=1
[MeterCoreCPU0]
Meter=Roundline
MeasureName=MeasureCore0
X=30
Y=30
H=60
W=60
StartAngle=(Rad(270))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreCPU1]
Meter=Roundline
MeasureName=MeasureCore1
X=30
Y=30
H=60
W=60
StartAngle=(Rad(0))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreCPU2]
Meter=Roundline
MeasureName=MeasureCore2
X=30
Y=30
H=60
W=60
StartAngle=(Rad(90))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreCPU3]
Meter=Roundline
MeasureName=MeasureCore0
X=30
Y=30
H=60
W=60
StartAngle=(Rad(180))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCPUValues]
Meter=String
MeasureName=MeasureCore0
MeasureName2=MeasureCore1
MeasureName3=MeasureCore2
MeasureName4=MeasureCore3
X=60
Y=60
FontFace=#MyFont#
FontSize=8
FontColor=#Blue#
AntiAlias=1
ClipString=1
StringAlign=CenterCenter
Text=0:%1%#CRLF#3:%4% 1:%2%#CRLF#2:%3%
```

You do not have the required permissions to view the files attached to this post.

CyberTheWorm
Posts: 766 Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada
Post
by CyberTheWorm » April 2nd, 2021, 5:44 pm

CyberTheWorm wrote: β April 2nd, 2021, 5:42 pm
Actually you can use Roundline.

2021-04-02_10h38_31.png

Here is the code I used, I'm sure you could edit this and get what you want.

Code: Select all

```
[Rainmeter]
Update=1000
[Metadata]
Author=CyberTheWorm
Version=1.0.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Circle CPU Monitor
;-------------------- Variables ----------------------
[Variables]
Blue=126,217,241,255
LightBlue=126,217,241,100
BlueBackground=69,150,221,255
MyFont=Arial
;-------------------- Measures ----------------------
[MeasureAverageCPU]
Measure=CPU
[MeasureCore0]
Measure=CPU
Processor=0
[MeasureCore1]
Measure=CPU
Processor=1
[MeasureCore2]
Measure=CPU
Processor=2
[MeasureCore3]
Measure=CPU
Processor=3
;-------------------- Meters ----------------------
;Transparent background to enable click anywhere on meter
[MeterBackground]
Meter=Roundline
X=0
Y=0
H=120
W=120
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineLength=60
LineColor=0,0,0,1
Solid=1
AntiAlias=1
[MeterAverageCPUBackground]
Meter=Roundline
X=0
Y=0
H=120
W=120
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineLength=60
LineStart=50
LineColor=#LightBlue#
Solid=1
AntiAlias=1
[MeterAverageCPU]
Meter=Roundline
MeasureName=MeasureAverageCPU
X=30
Y=30
H=60
W=60
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineLength=60
LineStart=50
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreBackground]
Meter=Roundline
X=30
Y=30
H=60
W=60
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
LineLength=49
LineStart=39
LineColor=#LightBlue#
Solid=1
AntiAlias=1
[MeterCoreCPU0]
Meter=Roundline
MeasureName=MeasureCore0
X=30
Y=30
H=60
W=60
StartAngle=(Rad(270))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreCPU1]
Meter=Roundline
MeasureName=MeasureCore1
X=30
Y=30
H=60
W=60
StartAngle=(Rad(0))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreCPU2]
Meter=Roundline
MeasureName=MeasureCore2
X=30
Y=30
H=60
W=60
StartAngle=(Rad(90))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCoreCPU3]
Meter=Roundline
MeasureName=MeasureCore0
X=30
Y=30
H=60
W=60
StartAngle=(Rad(180))
RotationAngle=(Rad(90))
LineLength=49
LineStart=39
LineColor=#Blue#
Solid=1
AntiAlias=1
[MeterCPUValues]
Meter=String
MeasureName=MeasureCore0
MeasureName2=MeasureCore1
MeasureName3=MeasureCore2
MeasureName4=MeasureCore3
X=60
Y=60
FontFace=#MyFont#
FontSize=8
FontColor=#Blue#
AntiAlias=1
ClipString=1
StringAlign=CenterCenter
Text=0:%1%#CRLF#3:%4% 1:%2%#CRLF#2:%3%
```

Oops I see you need rounded ends

BlueJive
Posts: 25 Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy
Post
by BlueJive » April 2nd, 2021, 6:35 pm

CyberTheWorm wrote: β April 2nd, 2021, 5:44 pm
Oops I see you need rounded ends

Yes, sorry. That's what I'm going for

balala
Rainmeter Sage
Posts: 12545 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » April 2nd, 2021, 7:48 pm

My try to achieve this:

Code: Select all

```
[Rainmeter]
Update=1000
SkinWidth=(#CenterX#+#Radius#+10)
SkinHeight=(#CenterY#+#Radius#+10)
[Variables]
CenterX=200
CenterY=200
Radius=150
[MeasureCPU]
Measure=CPU
[MeterShape]
Meter=Shape
X=2
Y=2
Shape=Arc #CenterX#,(#CenterY#-#Radius#),(#CenterX#+#Radius#*Sin(Rad(((Clamp((360*([MeasureCPU]/([MeasureCPU:MaxValue]-[MeasureCPU:MinValue]))),0,180)+180)%360)))),(#CenterY#+#Radius#*Cos(Rad(((Clamp((360*([MeasureCPU]/([MeasureCPU:MaxValue]-[MeasureCPU:MinValue]))),0,180)+180)%360)))),#Radius#,#Radius#,0,1,0,0 | Extend MyModifiers
Shape2=Arc (#CenterX#+#Radius#*Sin(Rad(((180+180)%360)))),(#CenterY#+#Radius#*Cos(Rad(((180+180)%360)))),(#CenterX#+#Radius#*Sin(Rad(((Clamp((360*([MeasureCPU]/([MeasureCPU:MaxValue]-[MeasureCPU:MinValue]))),180,360)+180)%360)))),(#CenterY#+#Radius#*Cos(Rad(((Clamp((360*([MeasureCPU]/([MeasureCPU:MaxValue]-[MeasureCPU:MinValue]))),180,360)+180)%360)))),#Radius#,#Radius#,0,1,0,0 | Extend MyModifiers
MyModifiers=StrokeWidth 8 | Stroke Color 173,220,247,255 | Fill Color 0,0,0,0 | StrokeStartCap Round | StrokeEndCap Round
DynamicVariables=1
```

The skin using this code shows the CPU utilization, but you can replace the [MeasureCPU] measure with something else, if needed (just take care to replace the MeasureCPU measure name accordingly into the Shape and Shape2 options of the [MeterShape] meter if you replaced the name on the measure).

Also you can set the following variables:

CenterX and CenterY are the coordinates of the center of "roundline".
Radius is the radius of the same meter / arc.
BlueJive
Posts: 25 Joined: February 25th, 2021, 6:45 am
Location: Norway, Tromoy
Post
by BlueJive » April 8th, 2021, 10:42 am

Thank you so much! Worked a charm

balala
Rainmeter Sage
Posts: 12545 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » April 8th, 2021, 3:48 pm

BlueJive wrote: β April 8th, 2021, 10:42 am
Thank you so much! Worked a charm

Did it? I'm glad.