It is currently March 29th, 2024, 9:22 am

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Thread for help with the Shape meter

Post by prince1142003 »

Hi all. I noticed something that seemed a little odd to me when combining shapes with stroke widths.

Code: Select all

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

[.case1]
X=0
Y=5R
H=[#CURRENTSECTION#:W]
Shape=Rectangle 0,0,128,128 | StrokeWidth 0 | Fill Color 255,0,0,255
Shape2=Rectangle 0,0,128,128 | StrokeWidth 0
Shape3=Combine Shape | Intersect Shape2 | Scale ([#CURRENTSECTION#:W]/128),([#CURRENTSECTION#:W]/128),0,0
Shape4=Rectangle 12,12,104,104 | StrokeWidth 0 | Fill Color 0,255,0,255
Shape5=Combine Shape4 | Intersect Shape2 | Scale ([#CURRENTSECTION#:W]/128),([#CURRENTSECTION#:W]/128),0,0
DynamicVariables=1

[.case2]
X=5R
Y=r
Shape4=Rectangle 12,12,104,104 | StrokeWidth 1 | Fill Color 0,255,0,255

[Test1]
Meter=Shape
MeterStyle=.case1
W=64

[Test2]
Meter=Shape
MeterStyle=.case1 | .case2
W=64

[Test3]
Meter=Shape
MeterStyle=.case1
W=128

[Test4]
Meter=Shape
MeterStyle=.case1 | .case2
W=128

[Test5]
Meter=Shape
MeterStyle=.case1
W=256

[Test6]
Meter=Shape
MeterStyle=.case1 | .case2
W=256
This is how the above code is rendering for me:
Stroked Combined Shapes.png
The only difference between the two shapes is that one of the combined shapes for the meter on the right has a StrokeWidth of 1. Is this a bug, or an intended outcome of combining shapes?

I'm using Rainmeter 4.4.0.3348 beta

Edit: Corrected Update from 1 to 1000. Was a mistake, doesn't change the outcome on my end.
You do not have the required permissions to view the files attached to this post.
Last edited by prince1142003 on April 19th, 2020, 10:42 pm, edited 2 times in total.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Thread for help with the Shape meter

Post by ikarus1969 »

So i'm not sure what your expected behavior is in that case?
To me, at first sight, there's nothing wrong with the shapes. But maybe i have overseen something.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the Shape meter

Post by jsmorley »

That is really odd that just the change in StrokeWidth causes that weird offset. And in the 1st and 3rd "sets" but not the "2nd". I think Brian will need to weigh in on this one.
prince1142003
Posts: 56
Joined: December 27th, 2011, 12:32 pm

Re: Thread for help with the Shape meter

Post by prince1142003 »

jsmorley wrote: April 19th, 2020, 4:30 pm That is really odd that just the change in StrokeWidth causes that weird offset. And in the 1st and 3rd "sets" but not the "2nd". I think Brian will need to weigh in on this one.
I think it has something to do with the Scale modifier. The 2nd set has a scale that calculates out to 1,1,0,0, and displays correctly. The first and third sets have scales that calculate out to 0.5,0.5,0,0 and 2,2,0,0 respectively and seem to have issues.
Wyndia
Posts: 3
Joined: October 17th, 2020, 2:31 am

Re: Thread for help with the Shape meter

Post by Wyndia »

Hi, I hope this is allowed but I was wondering if I could have some help editing a skin from Ageo. Since the weather widget was broken, I combined the calender and time of day skins, and then I tried to make a background to make the text visible with a shape meter. However, I'm wondering if there's a way to get it to automatically scale it to the size of the skin other than manually putting in the sizes, and if there's a way to scale the background with the rest of the skin? I've never messed around in Rainmeter before so this is all new to me.

Code: Select all

 [Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]
LeftMouseDoubleClickAction=!ToggleConfig "Ageo\Settings" "Settings.ini"

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=0.9

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,50*#Scale#,40*#Scale#,25,25 | Fill Color 0,0,0,100  | StrokeWidth 0 
Shape2=Rectangle 0,0,50,50
Shape3=Combine Shape | Union Shape2
AntiAlias=1 
DynamicVariables=1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureTimeOfDay]
Measure=Time
Format="%H"
Substitute=#TimeOfDay#

[MeasureReminder]
Measure=Time
Format="%H"
Substitute=#WishReminder#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureTime]
Measure=Time
Format="%#Format#:%M"

[MeasureAmPm]
Measure=Time
Format="%p"

[MeasureDay]
Measure=Time
Format="%A"
Substitute=#Date#

[MeasureDate]
Measure=Time
Format="%d"
Substitute=#Date#

[MeasureMonth]
Measure=Time
Format="%B"
Substitute=#Date#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterDate]
Meter=String
MeasureName=MeasureDate
StringAlign=Left
FontFace=Gobold Bold
FontColor=0,0,0
FontSize=(250*#Scale#)
X=(0*#Scale#)
Y=(0*#Scale#)
Text="%1"
AntiAlias=1
InlineSetting=GradientColor | 90 | #Color2#,1 ; 0.10 | #Color2#,220 ; 0.50 

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterMonth]
Meter=String
MeasureName=MeasureMonth
StringAlign=Left
FontFace=Porter
FontColor=#Color1#
FontSize=(56*#Scale#)
X=(95*#Scale#)
Y=(170*#Scale#)
Text="%1"
AntiAlias=1

[MeterDay]
Meter=String
MeasureName=MeasureDay
StringAlign=Left
StringCase=Upper
FontFace=Porter
FontColor=#Color1#
FontSize=(12*#Scale#)
X=(45*#Scale#)
Y=(400*#Scale#)
Text="%1"
AntiAlias=1
Angle=(Rad(-90))
InlineSetting=CharacterSpacing | 7 | 7

;-------------------------------------------------------------
;-------------------------------------------------------------

[Meter24hClock]
Meter=String
MeasureName=MeasureTime
StringAlign=Left
FontFace=Porter
FontColor=#Color1#
FontSize=(16*#Scale#)
X=(100*#Scale#)
Y=(260*#Scale#)
Text="%1"
AntiAlias=1
Hidden=#Hidden#

[Meter12hClock]
Meter=String
MeasureName=MeasureTime
MeasureName2=MeasureAmPm
StringAlign=Left
FontFace=Porter
FontColor=#Color1#
FontSize=(16*#Scale#)
X=(0*#Scale#)r
Y=(0*#Scale#)r
Text="%1 %2"
AntiAlias=1
Hidden=#Hidden2#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterLine]
Meter=Shape
X=(100*#Scale#)
Y=(300*#Scale#)
Shape=Rectangle 0,0,(85*#Scale#),(1.5*#Scale#) | Fill Color #Color1# | StrokeWidth 0 | Stroke Color #Color1#,0
UpdateDivider=-1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterTimeOfDay]
Meter=String
MeasureName=MeasureTimeOfDay
StringAlign=Left
FontFace=Glacial Indifference
FontColor=#Color1#
FontSize=(13*#Scale#)
X=(100*#Scale#)
Y=(340*#Scale#)
Text="%1, #UserName#."
AntiAlias=1
InlinePattern="#UserName#"
InlineSetting=Color | #Color2#
AntiAlias=1
DynamicVariables=1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterReminder]
Meter=String
MeasureName=MeasureReminder
StringAlign=Left
FontColor=#Color1#
FontFace=Glacial Indifference
FontSize=(13*#Scale#)
X=(100*#Scale#)
Y=(0*#Scale#)R
Text="%1"
AntiAlias=1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the Shape meter

Post by balala »

Wyndia wrote: October 17th, 2020, 4:37 am I was wondering if I could have some help editing a skin from Ageo. Since the weather widget was broken, I combined the calender and time of day skins, and then I tried to make a background to make the text visible with a shape meter. However, I'm wondering if there's a way to get it to automatically scale it to the size of the skin other than manually putting in the sizes, and if there's a way to scale the background with the rest of the skin?
The skin already has a Shape meter, used as background, named [MeterBackground], but me personally don't see its relevance. So I'd replace it with a real background meter, like the following one:

Code: Select all

[MeterBackground]
Meter=Shape
X=2
Y=2
Shape=Rectangle 0,0,(500*#Scale#),(450*#Scale#),25,25 | Fill Color 0,0,0,100  | StrokeWidth 2 | Stroke Color 255,255,255,180 
AntiAlias=1 
DynamicVariables=1
You can replace the color codes of both the Fill Color and Stroke Color into the Shape option, to get the desired colors.
Give a try to this and let me know if it is ok, or you wish to furtherly adjust the background.
Wyndia
Posts: 3
Joined: October 17th, 2020, 2:31 am

Re: Thread for help with the Shape meter

Post by Wyndia »

balala wrote: October 17th, 2020, 1:31 pm The skin already has a Shape meter, used as background, named [MeterBackground], but me personally don't see its relevance. So I'd replace it with a real background meter, like the following one:

Code: Select all

[MeterBackground]
Meter=Shape
X=2
Y=2
Shape=Rectangle 0,0,(500*#Scale#),(450*#Scale#),25,25 | Fill Color 0,0,0,100  | StrokeWidth 2 | Stroke Color 255,255,255,180 
AntiAlias=1 
DynamicVariables=1
You can replace the color codes of both the Fill Color and Stroke Color into the Shape option, to get the desired colors.
Give a try to this and let me know if it is ok, or you wish to furtherly adjust the background.
Ah, I should have clarified that the [MeterBackground] was me, testing it to see how it would work. The one you gave me works great, I couldn't figure out why it wasn't scaling, but I notice you put the H/W numbers in parenthesis along with #Scale#, so I assume that's how it works?

I was also wondering if it was possible to have the shape size be defined by percentages and not exact numbers, ie is it possible to tell the shape to fill 100% of the area already used, or does it need to be defined by exact numbers?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the Shape meter

Post by balala »

Wyndia wrote: October 17th, 2020, 9:43 pm I couldn't figure out why it wasn't scaling, but I notice you put the H/W numbers in parenthesis along with #Scale#, so I assume that's how it works?
Yes, you have to use those parentheses, otherwise it doesn't work. So I assume now it does scale, is it?
Wyndia wrote: October 17th, 2020, 9:43 pm I was also wondering if it was possible to have the shape size be defined by percentages and not exact numbers, ie is it possible to tell the shape to fill 100% of the area already used, or does it need to be defined by exact numbers?
You have to use numbers but there are two things: first my above code from start is using the #Scale# parameter (variable) into the Shape option and additinally the Shape meters have a Scale parameter, so they are easily scalable. So far I don't see what exactly is your intention and due to this, I'm not sure how could you scale the shapes. So please let me know a few more details.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

Wyndia wrote: October 17th, 2020, 9:43 pmI was also wondering if it was possible to have the shape size be defined by percentages and not exact numbers, ie is it possible to tell the shape to fill 100% of the area already used, or does it need to be defined by exact numbers?
balala wrote: October 18th, 2020, 10:41 amSo far I don't see what exactly is your intention and due to this, I'm not sure how could you scale the shapes. So please let me know a few more details.
It's possible that he may mean something like ((#Percent#/100)*[MeterBackground:W]),((#Percent#/100)*[MeterBackground:H])... :confused: That could in theory work, but it would still need some reference numbers to be used as width and height, at least the first time the formula is parsed - or otherwise the results will just be 0.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the Shape meter

Post by balala »

Yincognito wrote: October 18th, 2020, 11:53 am It's possible that he may mean something like ((#Percent#/100)*[MeterBackground:W]),((#Percent#/100)*[MeterBackground:H])... :confused: That could in theory work, but it would still need some reference numbers to be used as width and height, at least the first time the formula is parsed - or otherwise the results will just be 0.
So let's wait for Wyndia's reply...