Now you are going to have to stay after class, to catch up with the other kids!balala wrote:Thanks both of you, for the trusting me.
These days I worked a lot with a new plugin, which I wrote. Practically it's ready, I'm testing it deeply, but due to this, I had no time to study the new shape meter. In fact I didn't even install the newest version of Rainmeter, so my installed software don't even support yet this new meter type. Now that I have much less work with the plugin, I'll install the latest upgrade of Rainmeter, to test the new meter. I became interested to see how it works.
Will come back a bit later...
It is currently April 26th, 2024, 9:32 pm
How can I use the new vector Shapes to make an analog clock skin?
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How can I use the new vector Shapes to make an analog clock skin?
-
- Rainmeter Sage
- Posts: 16174
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How can I use the new vector Shapes to make an analog clock skin?
Yeah, you're right, my fault!jsmorley wrote:Now you are going to have to stay after class, to catch up with the other kids!
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How can I use the new vector Shapes to make an analog clock skin?
By the way SilverAzide, here is how you might do that "bounce" effect:
Code: Select all
[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1
[MeasureSecond]
Measure=Time
Format=%#S
OnChangeAction=[!CommandMeasure MeasureBounce "Reset"]
[MeasureSecondAngle]
Measure=Calc
Formula=(MeasureSecond * 6)
[MeasureMinute]
Measure=Time
Format=%#M
[MeasureMinuteAngle]
Measure=Calc
Formula=(MeasureMinute * 6) + (MeasureSecond / 60 * 6)
[MeasureHour]
Measure=Time
Format=%#I
[MeasureHourAngle]
Measure=Calc
Formula=(MeasureHour * 30) + (MeasureMinute / 60 * 30) + (MeasureSecond / 3600 * 30)
[MeasureBounce]
Measure=Loop
StartValue=0
EndValue=2
Increment=2
InvertMeasure=1
LoopCount=1
[MeterAnalogClock]
Meter=Shape
X=101
Y=1
W=101
H=201
Shape=Ellipse 0,100,90 | StrokeWidth 2 | Fill Color 247,244,178,255
Shape2=Line 0,100,0,20 | StrokeWidth 6 | Stroke Color 214,105,86,255 | StrokeEndCap Round | Rotate ([MeasureSecondAngle] + [MeasureBounce]),3,80
Shape3=Line 0,100,0,25 | StrokeWidth 6 | Stroke Color 86,214,99,255 | StrokeEndCap Round | Rotate [MeasureMinuteAngle],3,75
Shape4=Line 0,100,0,50 | StrokeWidth 6 | Stroke Color 86,174,214,255 | StrokeStartCap Round| StrokeEndCap Round | Rotate [MeasureHourAngle],3,50
Shape5=Ellipse 0,100,10 | StrokeWidth 0 | Fill Color 21,63,105,255
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16174
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How can I use the new vector Shapes to make an analog clock skin?
The following code is the jsmorley's clock, with smoothed movement of the hands, including the seconds hand. For this, I had to use the ActionTimer plugin, because I didn't want to decrease too much the Update value of the skin. This last parameter is set to the default 1000.
The movement of the minutes and hours hands is smoothed by jsmorley, I modified slightly his measures, then I worked only on smoothing the movement of the seconds hand. For this, I had to use a variable, named Sec, which is added to the old [MeasureSecondAngle] measure. This variable represents the variation of the angle of the seconds hand, during one second. On each update cycle, the value of this variable is cycled from 0 to 5 and it's added (as I said) to the old [MeasureSecondAngle] measure.
Please let me know how it's working and what you think.
The code:
The movement of the minutes and hours hands is smoothed by jsmorley, I modified slightly his measures, then I worked only on smoothing the movement of the seconds hand. For this, I had to use a variable, named Sec, which is added to the old [MeasureSecondAngle] measure. This variable represents the variation of the angle of the seconds hand, during one second. On each update cycle, the value of this variable is cycled from 0 to 5 and it's added (as I said) to the old [MeasureSecondAngle] measure.
Please let me know how it's working and what you think.
The code:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
Sec=0
U=[!UpdateMeasure "MeasureSlide1"][!UpdateMeasure "MeasureSecondAngle"][!UpdateMeasure "MeasureSec"][!UpdateMeter "MeterShape"][!Redraw]
[MeasureSlide1]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Left,166,6
Left=[!SetVariable Sec "(Clamp((#Sec#+1),0,6))"]#U#
DynamicVariables=1
[MeasureSec]
Measure=Calc
Formula=#Sec#
IfCondition=(MeasureSec=5)
IfTrueAction=[!SetVariable Sec "0"][!CommandMeasure MeasureSlide1 "Stop 1"][!UpdateMeasure "MeasureSlide1"]
DynamicVariables=1
[MeasureSecond]
Measure=Time
Format=%#S
OnChangeAction=[!CommandMeasure MeasureSlide1 "Execute 1"]
[MeasureSecondAngle]
Measure=Calc
Formula=( MeasureSecond * 6 + #Sec# )
DynamicVariables=1
[MeasureMinute]
Measure=Time
Format=%#M
[MeasureMinuteAngle]
Measure=Calc
Formula=(( 6 * MeasureMinute ) + ( MeasureSecond / 10 ))
[MeasureHour]
Measure=Time
Format=%#I
[MeasureHourAngle]
Measure=Calc
Formula=(( 30 * MeasureHour ) + ( MeasureMinute / 2 ) + ( MeasureSecond / 120 ))
[MeterShape]
Meter=Shape
X=103
Y=3
W=103
H=203
Shape=Ellipse 0,100,90 | StrokeWidth 2 | Fill Color 247,244,178,255
Shape2=Line 0,100,0,20 | StrokeWidth 6 | Stroke Color 214,105,86,255 | StrokeEndCap Round | Rotate [MeasureSecondAngle],3,80
Shape3=Line 0,100,0,35 | StrokeWidth 6 | Stroke Color 86,214,99,255 | StrokeEndCap Round | Rotate [MeasureMinuteAngle],3,65
Shape4=Line 0,100,0,50 | StrokeWidth 6 | Stroke Color 86,174,214,255 | StrokeEndCap Round | Rotate [MeasureHourAngle],3,50
Shape5=Ellipse 0,100,10 | StrokeWidth 0 | Fill Color 21,63,105,255
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 2611
- Joined: March 23rd, 2015, 5:26 pm
Re: How can I use the new vector Shapes to make an analog clock skin?
Haha! That's great! And you didn't even need any fancy math to do it, either. I was kind of hoping for some hyperbolic cosines or something... but this works nicely anyway.jsmorley wrote:By the way SilverAzide, here is how you might do that "bounce" effect:
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How can I use the new vector Shapes to make an analog clock skin?
No Quantum Entanglement required...SilverAzide wrote: Haha! That's great! And you didn't even need any fancy math to do it, either. I was kind of hoping for some hyperbolic cosines or something... but this works nicely anyway.