It is currently June 16th, 2021, 11:33 am

Thread for help with the Shape meter

Help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 390
Joined: September 7th, 2020, 2:24 pm

Re: Thread for help with the Shape meter

Post by CodeCode »

death.crafter wrote: June 8th, 2021, 1:58 pm I made changes only to the CPU bar but rest are the same so I guess you can change them accordingly:

Here is the code:

Code: Select all

[MeasureCPU]
Measure=CPU
Processor=0

;[TrapTLL]
;Meter=Shape
;X=96
;Y=305
;Shape=Path TopFrame | Strokewidth 2 | Stroke Color #Main# | Fill Color 0,0,0,100
;TopFrame=10, 80 | LineTo 277,95 | LineTo 272,118 | LineTo 0, 125 | ClosePath 1

[ProgBarLTL]
Meter=Shape
X=96
Y=305
Shape=Path TopBar | Fill Color #Goth#,130 | StrokeWidth 0
TopBar=10, 80 | LineTo (10+267*[MeasureCPU]/100),(80+15*[MeasureCPU]/100) | LineTo (282*[MeasureCPU]/100),(125-7*[MeasureCPU]/100) | LineTo 0, 125 | ClosePath 1
Shape2=Path TopFrame | StrokeWidth 2 | StrokeColor #Main# | Fill Color 00000000
TopFrame=10, 80 | LineTo 277,95 | LineTo 272,118 | LineTo 0, 125 | ClosePath 1
DynamicVariables=1
Container=TrapTLL
What I did:
Changed the progress bar to the current one. Doing so I eliminated the need of a container(it's commented out in the above code), which was kinda lame cause it ate half the stroke width and little pieces from the corner.

You can replace the code in your ini to see the changes.

Edit: And yes I couldn't figure out the alpha correctly so you have to change that too.😋
Hey, thanks for the examples. I made a weirdly simple change and the alpha etc is better than expected, and matches the rest of the skin better.
But I cannot figure out how you figured the ratios of x+x for the different LineTo X,Y
I'll post what I have tried, and you can see that the simple plus and minus math is simply not the same even when off by the amount it is off in this version.
I guess that the one good thing is the alpha is perfect now, I think.
NeoGothica_1.xx.x.rmskin
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Posts: 176
Joined: April 24th, 2021, 8:13 pm

Re: Thread for help with the Shape meter

Post by death.crafter »

CodeCode wrote: June 9th, 2021, 2:57 am Hey, thanks for the examples. I made a weirdly simple change and the alpha etc is better than expected, and matches the rest of the skin better.
But I cannot figure out how you figured the ratios of x+x for the different LineTo X,Y
I'll post what I have tried, and you can see that the simple plus and minus math is simply not the same even when off by the amount it is off in this version.
I guess that the one good thing is the alpha is perfect now, I think.
NeoGothica_1.xx.x.rmskin
from the Realm of Death
User avatar
CodeCode
Posts: 390
Joined: September 7th, 2020, 2:24 pm

Re: Thread for help with the Shape meter

Post by CodeCode »

Hey. I am not quite finished yet. But thanks soo much death.crafter, for that PERFECT explanation!

Things are looking really good. Just getting the math in my head for some reason is a bit of a puzzle still. But when I read the diagram, I am able to work it out fairly decently quickly. The left side is done, now for the right side. Just taking breaks in between sessions. :oops:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Posts: 3184
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

CodeCode wrote: June 10th, 2021, 3:33 am Hey. I am not quite finished yet. But thanks soo much death.crafter, for that PERFECT explanation!

Things are looking really good. Just getting the math in my head for some reason is a bit of a puzzle still. But when I read the diagram, I am able to work it out fairly decently quickly. The left side is done, now for the right side. Just taking breaks in between sessions. :oops:
You should make a subscription to death.crafter's Geometry 101 classes on YT, he seems to do a great job explaining stuff. ;-)

On the math thing here, it's all about (I split the phrase into parts below, for a better understanding - upper formula in the video screenshot used):
- adding or subtracting, based on Rainmeter's system of coordinates, which has the (0,0) point at top left corner of the skin (i.e. +) ...
- a part proportional with the progress value (i.e. * 0.5) ...
- of the difference between the X or Y coordinates of the larger trapezoid base and the smaller one (i.e. 270 - 20) ...
- from the larger base's X or Y coordinates (20)

That way you get to the final X = 20 + (270 - 20) * 0.5 and similar formulas in death.crafter's video. Obviously, if you use the smaller trapezoid base as a basis / reference, then stuff will get added or subtracted from its coordinates instead, and the values in the difference from the 3rd bullet above will permutate accordingly.

Note: Trapezoid bases are the trapezoid edges that are parallel to each other. Not really the case above due to simulating a "perspective view" of the shape, but in this case they are the left and right edges of the shape.
User avatar
balala
Rainmeter Sage
Posts: 12782
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the Shape meter

Post by balala »

Yincognito wrote: June 10th, 2021, 12:41 pm That way you get to the final X = 20 + (270 - 20) * 0.5 and similar formulas in death.crafter's video.
Didn't closely follow the whole discussion (so might miss something), however the above X option doesn't work this way. If formulas are used, you have to include the whole formula in parenthesis. Something like this: X = (20 + (270 - 20) * 0.5).
User avatar
Yincognito
Posts: 3184
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

balala wrote: June 10th, 2021, 2:06 pm Didn't closely follow the whole discussion (so might miss something), however the above X option doesn't work this way. If formulas are used, you have to include the whole formula in parenthesis. Something like this: X = (20 + (270 - 20) * 0.5).
Of course. I was talking on the base of the mathematical formulas displayed in death.crafter's YT video above, not in a strict Rainmeter coding sense. Having lots of brackets, while required in the skin itself, would have made the explanation and examples unnecessarily verbose. This and the video I used as a basis for the explanation are the main reasons for writing things the way I did. :)
User avatar
balala
Rainmeter Sage
Posts: 12782
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the Shape meter

Post by balala »

Yincognito wrote: June 10th, 2021, 2:16 pm Of course. I was talking on the base of the mathematical formulas displayed in death.crafter's YT video above, not in a strict Rainmeter coding sense. Having lots of brackets, while required in the skin itself, would have made the explanation and examples unnecessarily verbose. This and the video I used as a basis for the explanation are the main reasons for writing things the way I did. :)
Alright, and I just commented not to mislead users.
User avatar
Yincognito
Posts: 3184
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

balala wrote: June 10th, 2021, 2:26 pm Alright, and I just commented not to mislead users.
True - a welcomed and spot on note when it comes to the actual coding. :thumbup:
User avatar
CodeCode
Posts: 390
Joined: September 7th, 2020, 2:24 pm

Re: Thread for help with the Shape meter

Post by CodeCode »

Even with the plain-as-day explanations, I am stumped on this trapezoid:

Code: Select all

Shape=Path TopFrameR | Strokewidth 2 | Stroke Color #Main# | Fill Color #Main#,100
TopFrameR=10, 125 | LineTo 275,80 | LineTo 285,132 | LineTo 15, 149 | ClosePath 1
Shape2=Path TopBarR | Fill Color #Goth#,150 | StrokeWidth 0
TopBarR=10, 125 | LineTo (10+265*#MeasureGPUTemp#/100),(125-45*#MeasureGPUTemp#/100) | LineTo (270+15*#MeasureGPUTemp#/100),(149-17*#MeasureGPUTemp#/100) | LineTo 15, 149 | ClosePath 1
TopFrameR is perfect.
TopBarR just wont go right. To my understandings (limited as they are, indeed) and death.crafters coordinate example video, What I posted above, looks correct. But no, it isnt correct.

Please help.
Thanks.

EDIT: OMG I was using the variable "#" and not the measure "[]". It's fine now. Sorry for being so blind.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 390
Joined: September 7th, 2020, 2:24 pm

Re: Thread for help with the Shape meter

Post by CodeCode »

Hello,

New puzzle.
Using InvertMeasure to have yellow progress from right to left.

I'm tryin this:

Code: Select all

[MeasureGPUTemp]
Measure=Loop
StartValue=0
EndValue=100
Increment=4

[MeasureGPUTemp2]
Measure=Loop
StartValue=0
EndValue=100
Increment=4
InvertMeasure=1

[ProgBarRTA]
Meter=Shape
X=1530
Y=215
Shape=Path TopFrame | Strokewidth 2 | Stroke Color #Main#,200 | Fill Color #Main#,100
TopFrame=0, 125 | LineTo (265*[MeasureGPUTemp2]/100),(125-45*[MeasureGPUTemp2]/100) | LineTo (5+270*[MeasureGPUTemp2]/100),(149-17*[MeasureGPUTemp2]/100) | LineTo 5, 149 | ClosePath 1
DynamicVariables=1

[ProgBarRTB]
Meter=Shape
X=1530
Y=215
Shape=Path TopBar | Strokewidth 2 | Stroke Color #Main#,100 | Fill Color #Goth#,200
TopBar=0, 125 | LineTo (265*[MeasureGPUTemp]/100),(125-45*[MeasureGPUTemp]/100) | LineTo (5+270*[MeasureGPUTemp]/100),(149-17*[MeasureGPUTemp]/100) | LineTo 5, 149 | ClosePath 1
DynamicVariables=1
It seems possible, but the obvious is that the different bars are not actually reversed, just moving from opposite Min/Max.

Everything so far:
NeoGothica_1.2xx.rmskin
Th original trapezoid is commented out beneath the above shapes found starting on line 955
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.