It is currently May 27th, 2020, 3:37 am

Help: Switching wallpapers with a button

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 1639
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, 10:54 pm
Okay, i'm getting to understand it better. With a schematic, i'm not gonna lie, it's way more easy to understand.
Yeah, well, that's why they say that an image is worth a thousand words... :D
Mino_el_Nukenin wrote:
May 12th, 2020, 10:54 pm
Not sure I got the angle part, since every new shape will be relative to the precedent, with just some pixels in between.
Ok, I'll spare you of the effort (again, LOL), and just serve you everything on a plate (just cause I'm such a nice guy and I like your projects visually, don't get it to your head... :p ).

The code - it's not as complicated as the mix of variables and formulas make it look like:

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

[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
Preview:
Circle & Arc.jpg
Ellipse & Arc.jpg
I only had to hack a little formula to take care of the arc's sweep direction, as I wanted it included in the whole thing and make everything "customizable". And yes, it works even if you set the arc radius to less, or if you want to change the sweep direction, or if you set other ellipse/arc stroke widths, or if you change the angles, or if you want the arc to "touch" an actual ellipse instead of a circle, or if you ... well, you get the point, LMAO. Just set everything from the variables and the rest will adapt to it. 8-)
You do not have the required permissions to view the files attached to this post.
Mino_el_Nukenin
Posts: 181
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:19 pm
Ok, I'll spare you of the effort (again, LOL), and just serve you everything on a plate (just cause I'm such a nice guy and I like your projects visually, don't get it to your head... :p ).
Well, not really an effort, I was just lost in the numbers as I couldn't visualize it. I need to see thing...
But again, a big thanks ! It's impresive !

Now I get to paly with the numbers and see how it works (Im' getting to understand it).
I will be albe to add others arc shapes then.

I only had to hack a little formula to take care of the arc's sweep direction, as I wanted it included in the whole thing and make everything "customizable". And yes, it works even if you set the arc radius to less, or if you want to change the sweep direction, or if you set other ellipse/arc stroke widths, or if you change the angles, or if you want the arc to "touch" an actual ellipse instead of a circle, or if you ... well, you get the point, LMAO. Just set everything from the variables and the rest will adapt to it. 8-)
This is just wow !
User avatar
Yincognito
Posts: 1639
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:35 pm
Well, not really an effort, I was just lost in the numbers as I couldn't visualize it. I need to see thing...
But again, a big thanks ! It's impresive !

Now I get to paly with the numbers and see how it works (Im' getting to understand it).
I will be albe to add others arc shapes then.



This is just wow !
By the way, I knew this can be done easier ... if I'm not mistaken, this can be done using Roundline meters as well.
Mino_el_Nukenin
Posts: 181
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
Posts: 1639
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.
Mino_el_Nukenin
Posts: 181
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
Posts: 1639
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 am
EDIT 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 am
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.
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.
Mino_el_Nukenin
Posts: 181
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
Posts: 1639
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.
Mino_el_Nukenin
Posts: 181
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... :-(