Yep. Apples and lines, always surprising ... especially in Rainmeter

Yep. Apples and lines, always surprising ... especially in Rainmeter
Excellent, thank you!
I would have made it even shorter: inclusive/exclusive and 'required', separated by commas, inside the brackets corresponding to EndX and EndY - but that's just me. Anyway, credits to jsmorley for assessing this and inserting the note there - that's nice to see there are still software where users are listen to, once in a while.
Code: Select all
[Rainmeter]
Author=Behrooz
Update=-1
[Variables]
Xpoint1=23
Ypoint1=140
Xpoint2=50
Ypoint2=150
Speed=60
inNStep=20
NbyN=3
updateroutin=[!UpdateMeasure MeasureShiftPoints][!UpdateMeter "animation_ready_meter"][!Redraw]
;;====================================================
;; Measures
;;====================================================
[MeasureShiftPoints]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Addtopoints,#Speed#,#inNStep#
Addtopoints=[!SetVariable Ypoint1 "(Clamp(#Ypoint1#+#NbyN#,100,140))"][!SetVariable Ypoint2 "(Clamp(#Ypoint2#-#NbyN#,150,210))"] [!SetVariable Xpoint2 "(Clamp(#Xpoint2#+#NbyN#,50,80))"]#updateroutin#
ActionList2=Repeat Subtractpoints,#Speed#,#inNStep#
Subtractpoints=[!SetVariable Ypoint1 "(Clamp(#Ypoint1#-#NbyN#,100,140))"][!SetVariable Ypoint2 "(Clamp(#Ypoint2#+#NbyN#,150,210))"] [!SetVariable Xpoint2 "(Clamp(#Xpoint2#-#NbyN#,50,80))"]#updateroutin#
IfCondition=#Ypoint2#<151
IfTrueAction=[!CommandMeasure MeasureShiftPoints "Stop 1"][!CommandMeasure MeasureShiftPoints "Execute 2"]
IfCondition2=#Ypoint2#>209
IfTrueAction2=[!CommandMeasure MeasureShiftPoints "Stop 2"][!CommandMeasure MeasureShiftPoints "Execute 1"]
DynamicVariables=1
;;====================================================
;; Meters
;;====================================================
[Rainmeterlogo]
x=30
y=30
meter=shape
Shape=Curve 67,0,0,156,46,94,0,118 | Extend StrokeDef
Shape2=Curve 67,0,134,156,88,94,134,118 | Extend StrokeDef
Shape3=Arc 0,156,134,156,*,*,*,1,*,0 | Extend StrokeDef
StrokeDef=StrokeWidth 8 | StrokeColor 129,212,222,255 | StrokeStartCap Round | StrokeEndCap Round | fill color 0,0,0,1
[animation_ready_meter]
meter=shape
x=30
y=30
Shape=Curve 23,156,111,156,#Xpoint1#,#Ypoint1#,#Xpoint2#,#Ypoint2# | Extend StrokeDef
Shape2=Arc 23,156,111,156,*,*,*,1,*,0 | Extend StrokeDef
StrokeDef=StrokeWidth 8 | StrokeColor 220,190,34,255 | StrokeStartCap Round | StrokeEndCap Round
DynamicVariables=1
Code: Select all
[animation_ready_meter]
meter=shape
x=30
y=30
DynamicVariables=1
Shape = Path Path1 | StrokeWidth 0 | StrokeColor 33,216,207,255 | fill color 24,215,208,255
Path1 = 23, 156 | CurveTo 111,156,#Xpoint1#,#Ypoint1#,#Xpoint2#,#Ypoint2# | CurveTo 67,200,111,180,91,200 | CurveTo 23,156,42,200,23,180 | ClosePath 1
Here are two approaches that are visibly the same...
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Variables]
StrokeAlpha=255
StrokeWidth=8
[MeterShape1]
Meter=Shape
Shape=Rectangle 4,4,300,150 | StrokeWidth 8 | Stroke Color 47,47,47,#StrokeAlpha#
DynamicVariables=1
MouseOverAction=[!SetVariable StrokeAlpha "0"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetVariable StrokeAlpha "255"][!UpdateMeter *][!Redraw]
[MeterShape2]
Meter=Shape
Y=10R
Shape=Rectangle 4,4,300,150 | StrokeWidth #StrokeWidth# | Stroke Color 47,47,47,255
DynamicVariables=1
MouseOverAction=[!SetVariable StrokeWidth "0"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetVariable StrokeWidth "8"][!UpdateMeter *][!Redraw]