It is currently March 28th, 2024, 11:22 pm

Help: Switching wallpapers with a button

Get help with creating, editing & fixing problems with skins
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 12th, 2020, 11:37 pm By the way, I knew this can be done easier ... if I'm not mistaken, this can be done using Roundline meters as well.
Yes I briefly saw this one method before starting with shape. But it need a value. Here it's juste visual it won't use any data from the OS... so I though it wasn't the rigth method.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 12th, 2020, 11:42 pm Yes I briefly saw this one method before starting with shape. But it need a value. Here it's juste visual it won't use any data from the OS... so I though it wasn't the rigth method.
Yep - here it is the Roundline equivalent. I set a different color and a smaller "width" / thickness of the arc - actually, part of the "line" parameters in this case - (the -#ArcStrokeW#/2, which should have been -#ArcStrokeW#), so you can see all the meters involved. So yeah, it can be done easier using Roundline (don't know how I could miss this when initially replying, guess the music factor stroke again, LOL) ... but the drawback is that you're limited to an actual circle (and not a "free-form" ellipse).

The code (I let the rest just for comparison):

Code: Select all

[Variables]
EllipseFillColor=0,0,0,255
EllipseStrokeColor=255,255,255,255
ArcStrokeColor=255,0,0,255

EllipseStrokeW=2
EllipseCenterX=90
EllipseCenterY=90
EllipseRadiusX=89
EllipseRadiusY=89
ArcStrokeW=15
ArcCenterX=(#EllipseCenterX#)
ArcCenterY=(#EllipseCenterY#)
ArcRadiusX=(#EllipseRadiusX#-#EllipseStrokeW#/2-#ArcStrokeW#/2)
ArcRadiusY=(#EllipseRadiusY#-#EllipseStrokeW#/2-#ArcStrokeW#/2)
ArcAngleStart=60
ArcAngleEnd=240
ArcSweepDirection=1

RoundlineColor=0,0,255,255

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

---Meters---

[MeterShapes]
Meter=Shape
Shape=Ellipse #EllipseCenterX#,#EllipseCenterY#,#EllipseRadiusX#,#EllipseRadiusY# | Fill Color #EllipseFillColor# | StrokeWidth #EllipseStrokeW# | Stroke Color #EllipseStrokeColor#
Shape2=Arc (#ArcCenterX#+#ArcRadiusX#*Cos(Rad(#ArcAngleStart#))),(#ArcCenterY#+(1-2*#ArcSweepDirection#)*#ArcRadiusY#*Sin(Rad(#ArcAngleStart#))),(#ArcCenterX#+#ArcRadiusX#*Cos(Rad(#ArcAngleEnd#))),(#ArcCenterY#+(1-2*#ArcSweepDirection#)*#ArcRadiusY#*Sin(Rad(#ArcAngleEnd#))),#ArcRadiusX#,#ArcRadiusY#,360,#ArcSweepDirection#,0,0 | StrokeWidth #ArcStrokeW# | Stroke Color #ArcStrokeColor#
AntiAlias=1

[MeterRoundline]
Meter=Roundline
X=(#EllipseStrokeW#)r
Y=(#EllipseStrokeW#)r
W=(#EllipseRadiusX#*2-#EllipseStrokeW#)
H=(#EllipseRadiusY#*2-#EllipseStrokeW#)
LineColor=#RoundlineColor#
StartAngle=(Rad(-60))
RotationAngle=(Rad(-180))
LineStart=(#EllipseRadiusX#-#EllipseStrokeW#/2-#ArcStrokeW#/2)
LineLength=(#EllipseRadiusX#-#EllipseStrokeW#/2)
Solid=1
AntiAlias=1
Preview:
Circle & Arc & Roundline.jpg
Another difference here: the "rotation angle" is not absolute (i.e. 240 like in the other case), but rather the "length" of the arc in degrees from the starting angle onwards (i.e. 180). The values are negative since I wanted a counter-clockwise direction, to suit the previous results (the equivalent of the arc sweep direction in the other implementation).
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 13th, 2020, 12:19 am Yep - here it is the Roundline equivalent. I set a different color and a smaller "width" / thickness of the arc - actually, part of the "line" parameters in this case - (the -#ArcStrokeW#/2, which should have been -#ArcStrokeW#), so you can see all the meters involved. So yeah, it can be done easier using Roundline (don't know how I could miss this when initially replying, guess the music factor stroke again, LOL) ... but the drawback is that you're limited to an actual circle (and not a "free-form" ellipse).

Another difference here: the "rotation angle" is not absolute (i.e. 240 like in the other case), but rather the "length" of the arc in degrees from the starting angle onwards (i.e. 180). The values are negative since I wanted a counter-clockwise direction, to suit the previous results (the equivalent of the arc sweep direction in the other implementation).
Wow that's nice !
I'll stay with the first code, with the shape, since have already complete the first outer "circle" of arc shapes I want, see the result in image.
Now onto an inner circle of arc ! :sly:

EDIT : not sure what what variables i should copy and tweak for the inner arc to be "before" the others with a little space in between
EDIT 2 : okay found it, just add ArcRadiusX2=(#EllipseRadiusX#-12)
ArcRadiusY2=(#EllipseRadiusY#-12)
.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 13th, 2020, 12:36 amEDIT 2 : okay found it, just add ArcRadiusX2=(#EllipseRadiusX#-12) and ArcRadiusY2=(#EllipseRadiusY#-12).
Yes, that's right. ;-)
Mino_el_Nukenin wrote: May 13th, 2020, 12:36 amI'll stay with the first code, with the shape, since have already complete the first outer "circle" of arc shapes I want, see the result in image.
Well, I'm obviously glad that you stayed with my initial code, but if you don't want an arc for an actual ellipse and you want to understad what you did in the code 6 months from now, a Roundline approach is indeed easier, you just have to modify the angles for same radius stuff, and adjust a bit the line start and length on a different radius. You don't even need the variables, as things are relatively easy to add / subtract / multiply anyway:

Code: Select all

[MeterRoundline]
Meter=Roundline
X=2r
Y=2r
W=176
H=176
LineColor=0,0,255,255
StartAngle=(Rad(-60))
RotationAngle=(Rad(-180))
LineStart=73
LineLength=88
Solid=1
AntiAlias=1
2r = refers to the circle's stroke width, assuming the meter is positioned relative to the top left corner of the circle meter
88 = 89 - 1 = 89 - 2/2 = circle radius - half the circle's stroke width
176 = 2 * 89 - 2 = 2 * circle radius - circle's stroke width = 2 * line length = basically the diameter, including the arc's stroke
73 = 88 - 15 = 88 - arc's stroke width
Last edited by Yincognito on May 13th, 2020, 1:41 am, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 13th, 2020, 1:32 am Well, I'm obviously glad that you stayed with my initial code, but if you don't want an arc for an actual ellipse and you want to understad what you did in the code 6 months from now, a Roundline approach is indeed easier, you just have to modify the angles for same radius stuff, and adjust a bit the line start and length on a different radius. You don't even need the variables, as things are relatively easy to add / subtract / multiply subtract anyway:
2r = refers to the circle's stroke width, assuming the meter is positioned relative to the top left corner of the circle meter
88 = 89 - 1 = 89 - 2/2 = circle radius - half the circle's stroke width
176 = 2 * 89 - 2 = 2 * circle radius - circle's stroke width = 2 * line length = basically the diameter, including the arc's stroke
73 = 88 - 15 = 88 - arc's stroke width
Yeah I see, maybe I'll use it for not so complicate visual on another I have in mind.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: May 13th, 2020, 1:40 am Yeah I see, maybe I'll use it for not so complicate visual on another I have in mind.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Anyaway, next step is adding, some very small rectangles merged with some of the inner arcs to look like they "connect" we the button in the middle.
And then, if possible, have all the outer arcs to rotate clockwise while the inner arcs rotate counter-clockwise.
But that's for another day ! Sleep time for me, I've got lot of work to do first... god d*mned thesis... :-(
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

I'm trying to have different arc shapes rotating, based on the center of a circle.
I came up with this measure

Code: Select all

[MeasureRotateClockwise]
Measure=Calc
Formula=(MeasureRotateClockwise+1)%360
And then added Rotate [MeasureRotateClockwise],#EllipseCenterX#,#EllipseCenterY# at the end of the shape line code.
But no result.
Not sure what I missed.
Mino_el_Nukenin
Posts: 231
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: May 13th, 2020, 1:44 am
Any help with this rotating problem I have ?

I've modified the measure as one I saw on the forum:

Code: Select all

[MeasureRotate]
Measure=Loop
StartValue=0
EndValue=359
Added these variables :

Code: Select all

AnchorX=(#EllipseCenterX#-#ArcCenterX#+#ArcRadiusX#)
AnchorY=(#EllipseCenterY#-#ArcCenterY#+#ArcRadiusY#)
And this to the arcs I want to rotate, but nothing :
Rotate [MeasureRotate],#AnchorX#,#AnchorY#
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: May 13th, 2020, 7:51 pm And this to the arcs I want to rotate, but nothing :
Rotate [MeasureRotate],#AnchorX#,#AnchorY#
Have you added a DynamicVariables=1 option to that meter?