It is currently March 29th, 2024, 12:27 pm

Path Shape, Arcs, and System Information

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Path Shape, Arcs, and System Information

Post by balala »

zivallh wrote: October 8th, 2022, 8:23 pm You are a genius :) Thank you!!
No, I'm not at all. But am glad if you like it.
zivallh wrote: October 8th, 2022, 8:23 pm We can make it clockwise?
Yes, we can:

Code: Select all

[Rainmeter]
Update=1000
SkinWidth=(#CenterX#+#Radius#+10)
SkinHeight=(#CenterY#+#Radius#+10)

[Variables]
CenterX=200
CenterY=200
Radius=150

[MeasureVolume]
Measure=Plugin
Plugin=Win7AudioPlugin

[MeterShape]
Meter=Shape
X=2
Y=2
Shape=Arc #CenterX#,(#CenterY#-#Radius#),(#CenterX#+#Radius#*Sin(Rad(((-1*Clamp((360*([MeasureVolume:]/([MeasureVolume:MaxValue]-[MeasureVolume:MinValue]))),0,180)+180)%360)))),(#CenterY#+#Radius#*Cos(Rad(((-1*Clamp((360*([MeasureVolume:]/([MeasureVolume:MaxValue]-[MeasureVolume:MinValue]))),0,180)+180)%360)))),#Radius#,#Radius#,0,0,0,0 | Extend MyModifiers
Shape2=Arc (#CenterX#+#Radius#*Sin(Rad(((180+180)%360)))),(#CenterY#+#Radius#*Cos(Rad(((180+180)%360)))),(#CenterX#+#Radius#*Sin(Rad((-1*(Clamp((360*([MeasureVolume:]/([MeasureVolume:MaxValue]-[MeasureVolume:MinValue]))),180,360)+180)%360)))),(#CenterY#+#Radius#*Cos(Rad(((-1*Clamp((360*([MeasureVolume:]/([MeasureVolume:MaxValue]-[MeasureVolume:MinValue]))),180,360)+180)%360)))),#Radius#,#Radius#,0,0,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
Note what have been altered:
  • Multiplied the angles by -1, to get the arc extending in the opposite direction (see the -1*Clamp sections of the formulas used into the Shape and Shape2 options of the [MeterShape] meter).
  • Changed the SweepDirection parameter (the 8th) of both Shape options of the same meter from 1 to 0.
Test please the code and let me know if meats your need.
zivallh wrote: October 8th, 2022, 8:23 pm And if we can make it like "SetVolume" option when we click somewhere on that arc
Yep, probably can be done this as well, but this will be a next step. Stay tuned...
zivallh wrote: October 8th, 2022, 8:23 pm I saw another method from other skins as well but I couldn't understand what's the PI, I tried to use it with Volume as well, but it didn't work
Not sure I really understand why you've posted the last code. But if you are interested why PI is, here is a Wikipedia article about it.
User avatar
zivallh
Posts: 38
Joined: October 16th, 2019, 2:26 pm

Re: Path Shape, Arcs, and System Information

Post by zivallh »

Worked! :) Thank you!

Actually, I posted that code because it looks more simple and can be scaled with the skin, I tried to add the scale option to your code in the variables only

[Variables]
CenterX=(100*#Scale#)
CenterY=(100*#Scale#)
Radius=(50*#Scale#)

but it didn't work maybe I have to add it somewhere else in the arc itself

For the Set Volume
I have a skin that uses "Roundline" Meter and it's working with a script I am not sure if this gonna work with the arc,

Code: Select all


[MouseAngle]
Measure=Script
ScriptFile=#@#script.lua
DynamicVariables=1

[MeterRound]
Meter=Roundline
X=(70*#Scale#)
Y=(70*#Scale#)
Autoscale=1
StartAngle=(Rad(90))
;LineWidth=(17*#Scale#)
LineLength=(70*#Scale#)
LineStart=(69*#Scale#)
LineColor=#Color#,100
Solid=1
AntiAlias=1
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure MouseAngle "execute($MouseX:%$,$MouseY:%$)"]
The script

Code: Select all

function execute(x,y)
	local angle = math.deg(math.atan2(y - 50, x - 50)) + 90
	if angle < 0 then angle = angle + 360 end
	SKIN:Bang('!CommandMeasure', 'MeasureVolume', 'SetVolume '..(angle/3.6))
	SKIN:Bang('[!UpdateMeasure MeasureVolume][!UpdateMeter MeterIcon][!Redraw]')
end
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Path Shape, Arcs, and System Information

Post by balala »

zivallh wrote: October 9th, 2022, 10:54 am I tried to add the scale option to your code in the variables only

[Variables]
CenterX=(100*#Scale#)
CenterY=(100*#Scale#)
Radius=(50*#Scale#)

but it didn't work maybe I have to add it somewhere else in the arc itself
It does work, just have to make sure the Scale variable is added BEFORE the first one which uses it (in this case CenterX) in the [Variables] section:

Code: Select all

[Variables]
Scale=2
CenterX=(100*#Scale#)
CenterY=(100*#Scale#)
Radius=(50*#Scale#)
zivallh wrote: October 9th, 2022, 10:54 am For the Set Volume
I have a skin that uses "Roundline" Meter and it's working with a script I am not sure if this gonna work with the arc,
For now, I don't need it. I'm gonna take a look how can it be done, probably a plugin will be needed. But unfortunately, right now I don't have enough time to work with it. If you don1t mind, I let it for a bit later or tomorrow, if someone else doesn't come with a solution in meantime. Sorry...
User avatar
zivallh
Posts: 38
Joined: October 16th, 2019, 2:26 pm

Re: Path Shape, Arcs, and System Information

Post by zivallh »

Oh I didn’t noticed that about the scale it was under the CenterX/Y

No problem at all, you helped me alot with this thank you so much!!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Path Shape, Arcs, and System Information

Post by balala »

zivallh wrote: October 9th, 2022, 2:28 pm Oh I didn’t noticed that about the scale it was under the CenterX/Y
In many cases the order of sections for instance in Rainmeter doesn't matter, but the order of variables in the [Variables] section does extremely much.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Path Shape, Arcs, and System Information

Post by balala »

zivallh wrote: October 8th, 2022, 8:23 pm And if we can make it like "SetVolume" option when we click somewhere on that arc
I added the set volume feature to the skin, but it needs the Mouse plugin. I don't know if you have it, but I created an installer, which contains the plugin as well. Please install this package and try out the skin. What do you think about it?
You do not have the required permissions to view the files attached to this post.
User avatar
zivallh
Posts: 38
Joined: October 16th, 2019, 2:26 pm

Re: Path Shape, Arcs, and System Information

Post by zivallh »

Thank you so much!!

This is exactly what am looking for!

I'll upload for you the final skin after I change it with the set volume.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Path Shape, Arcs, and System Information

Post by balala »

zivallh wrote: October 11th, 2022, 4:04 pm Thank you so much!!

This is exactly what am looking for!

I'll upload for you the final skin after I change it with the set volume.
You're welcome. And alright, do so please.
User avatar
zivallh
Posts: 38
Joined: October 16th, 2019, 2:26 pm

Re: Path Shape, Arcs, and System Information

Post by zivallh »

It's working, I have attached the skin

but the problem, if we click anywhere inside or outside the skin will change the volume, even if we move the skin

I'm using your code as well for another skin for WEB player :rosegift:
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Path Shape, Arcs, and System Information

Post by balala »

zivallh wrote: October 11th, 2022, 9:09 pm It's working, I have attached the skin
I'm glad. I like the way the thickness of the background is increasing when hovering the mouse over it, then decreasing when leaving it. Congratulations, extremely good-looking addition.
zivallh wrote: October 11th, 2022, 9:09 pm but the problem, if we click anywhere inside or outside the skin will change the volume, even if we move the skin
To fix this remove the BackgroundMode and SolidColor options of the [Rainmeter] section (or comment them out, or it's enough even to modify the SolidColor to SolidColor=0,0,0,0) and modify the transparency of the Fill Color parameter of Shape option of the [MeterEllipse] meter to 0 (the red value here: Shape=Ellipse (2*#Radius#),(2*#Radius#),#Radius# | StrokeWidth ((2*#Scale#)*#Size#) | Fill Color #Color#,0 | StrokeColor #Color#,50).
And there is one more issue: when you1re scaling the skin (increasing the Scale variable), the volume icon (the [MeterIcon] meter) goes in a completely wrong place (check please). To fix this you have to change the values of the X and Y options of [MeterIcon]. A first and brute value might be:

Code: Select all

[MeterIcon]
...
X=(2*#Radius#-[MeterIcon:W]/2)
Y=(2*#Radius#-[MeterIcon:H]/2)
...
This is yet far from being perfect, but it's better, I think. You have to modify it a little bit more, to get the icon perfectly aligned.