It is currently October 15th, 2019, 7:50 pm

Thread for help with the new Shape meter

Help with creating, editing & fixing problems with skins
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Thread for help with the new Shape meter

Yincognito » January 15th, 2019, 1:31 am

jsmorley wrote:
January 15th, 2019, 1:19 am
As did William Tell... ;-)
Yep. Apples and lines, always surprising ... especially in Rainmeter :lol: (sorry, couldn't help it).
User avatar
qwerky
Posts: 182
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Thread for help with the new Shape meter

qwerky » January 15th, 2019, 1:44 am

Excellent, thank you! :rosegift: One could mention that vector graphics are in use, but it is great as is. :great:
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Thread for help with the new Shape meter

Yincognito » January 15th, 2019, 2:24 am

qwerky wrote:
January 15th, 2019, 1:44 am
Excellent, thank you! :rosegift: One could mention that vector graphics are in use, but it is great as is. :great:
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. ;-)

This note will come handy for newcomers in the Rainmeter world or to the Shape meters, as for the already accustomed, it feels natural, since most (if not all) of the meters act pretty much the same way. I only realized that later on, since I was focused on the differences between lines and rectanges in your example, at first.
User avatar
Behrooz
Posts: 2
Joined: February 3rd, 2019, 12:23 pm

Re: Thread for help with the new Shape meter

Behrooz » May 25th, 2019, 9:58 pm

Hello
I have been working on an animated Rainmeter Logo 8-) . Specifically I'm trying to "fill color" The Yellow shape or Blue one in this Rainmeter logo. I have problem with adding "Fill Color" to "Combine" shapes or adding "Fill Color" to a "Curve".
Is it possible to define which side of a "Interactive Cubic Bézier Shape" to be filled? Or Is it possible to make a Combined Shape made out of curves so that it can be filled with color?
I appreciate any other suggestion to improve this shape please. I'm a newbie
Thank you.

Image
Image

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

User avatar
Behrooz
Posts: 2
Joined: February 3rd, 2019, 12:23 pm

Re: Thread for help with the new Shape meter

Behrooz » May 28th, 2019, 3:45 pm

My apology. Using CurveTo I could make a closed curvy shape. don't know if it is best way but it seems to work.

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
User avatar
sl23
Posts: 362
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

sl23 » August 7th, 2019, 11:25 pm

Is there a way to show the stroke on hover? Maybe change StrokeWidth as the mouse hovers/leaves the meter?
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
jsmorley
Developer
Posts: 19558
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

jsmorley » August 7th, 2019, 11:37 pm

sl23 wrote:
August 7th, 2019, 11:25 pm
Is there a way to show the stroke on hover? Maybe change StrokeWidth as the mouse hovers/leaves the meter?
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]
User avatar
sl23
Posts: 362
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

sl23 » August 7th, 2019, 11:52 pm

Wow! that was quick! :thumbup:
Thanks.

I looked through the thread and found this:
[MeterRectangle]
Meter=Shape
X=10
Y=10
Shape=Rectangle 0,0,(100-(#sw#/2)),(100-(#sw#/2)) | StrokeWidth #sw# | Fill Color 255,0,0,255
MouseScrollDownAction=[!SetVariable sw "(#sw#<20 ? (#sw#+1) : 20)"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable sw "(#sw#>1 ? (#sw#-1) : 0)"][!UpdateMeter *][!Redraw]
DynamicVariables=1
I actually managed to figure this out and got it to work :jawdrop via this:
[Icon1]
Meter=Shape
MeterStyle=sHighlight
Shape=Rectangle 0,0,24,24,50 | Extend MyModifiers1
MyModifiers1=Fill Color 128,128,128 | StrokeWidth #sw# | Stroke Color 128,255,0
MouseOverAction=[!ShowMeter "Name1"][!SetVariable sw "(#sw#<1 ? (#sw#+4) : 4)"] [!UpdateMeter *] [!Redraw]
MouseLeaveAction=[!HideMeter "Name1"][!SetVariable sw "(#sw#>3 ? (#sw#-4) : 0)"] [!UpdateMeter *] [!Redraw]
LeftMouseUpAction=["D:\Documents\- TEST -\NTD1.txt"]
DynamicVariables=1
X=-4
Y=2

[Name1]
Meter=STRING
MeterStyle=sName
Text=NTD1
X=10R
Y=r
But your approach is far simpler, which I will use, thanks very much :D
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
sl23
Posts: 362
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

sl23 » August 8th, 2019, 12:04 am

Hmm... It worked, until I added it to the second meter for another launcher. Which, when hovered changes the first launcher not the second! lol

EDIT: Scrap that, I forgot to add the reference to the variable, sorry!!!

My work in progress (sorry, bit of a mess):
[Rainmeter]
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1

[Metadata]
Name= Mini Launch
Author=sl23

====================================================
[Variables]
sw=0
====================================================

[sIcon]
ImageName=1.png
DynamicVariables=1
X=0
Y=20r

[sName]
FontFace=Corbel
StringStyle=Bold
FontSize=12
FontColor=175,175,175
AntiAlias=1
Hidden=1
X=25
Y=r

[sHighlight]
MouseOverAction=[!SetOption #CURRENTSECTION# MyModifiers1 "StrokeWidth 4"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# MyModifiers1 "StrokeWidth 0"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]


========================================
; APP 1
========================================

[Icon1]
Meter=Shape
MeterStyle=sHighlight
Shape=Rectangle 0,0,24,24,50 | Extend MyModifiers1
MyModifiers1=Fill Color 128,128,128 | StrokeWidth #sw# | Stroke Color 128,255,0
MouseOverAction=[!ShowMeter "Name1"][!SetVariable sw "(#sw#<1 ? (#sw#+4) : 4)"] [!UpdateMeter *] [!Redraw]
MouseLeaveAction=[!HideMeter "Name1"][!SetVariable sw "(#sw#>3 ? (#sw#-4) : 0)"] [!UpdateMeter *] [!Redraw]
LeftMouseUpAction=["D:\Documents\- TEST -\NTD1.txt"]
DynamicVariables=1
X=-4
Y=2

[Name1]
Meter=STRING
MeterStyle=sName
Text=NTD1
X=10R
Y=r


========================================
; APP 2
========================================

[Icon2]
Meter=Shape
;MeterStyle=sHighlight
Shape=Rectangle 0,0,24,24,50 | Extend MyModifiers1
MyModifiers1=Fill Color 128,128,128 | StrokeWidth 4 | Stroke Color 128,255,0
MouseOverAction=[!ShowMeter "Name2"][!SetVariable sw "0"] [!UpdateMeter *] [!Redraw]
MouseLeaveAction=[!HideMeter "Name2"][!SetVariable sw "8"] [!UpdateMeter *] [!Redraw]
LeftMouseUpAction=["D:\Documents\- TEST -\NTD2.txt"]
DynamicVariables=1
X=-4
Y=30r

[Name2]
Meter=STRING
MeterStyle=sName
Text=NTD2
X=10R
Y=r

========================================
Oh, I also want the Stroke to show only on hover.
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
sl23
Posts: 362
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

sl23 » August 8th, 2019, 12:16 am

Actually, due to using this as a launcher, each section requires it's own mouse over instruction and variable.

In another skin I used this code as a MeterStyle in order to reduce repetition:
[sHighlight]
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "128,255,0"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor ""] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
It allowed any text to be highlighted by changing FontColor and return it to it's normal state. Without affecting any other sections.

Is it possible to use a similar instruction for the StrokeWidth?
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -