I would love for there to be a simple way to add shadows to shapes with a "Shadow [X],[Y],[W],[H]" and "ShadowColor [Color],[Opacity]" parameter.
It is currently April 27th, 2024, 7:04 am
Suggestion: A simple way to add Shadows to shapes
-
- Posts: 268
- Joined: May 12th, 2019, 8:55 am
Suggestion: A simple way to add Shadows to shapes
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Suggestion: A simple way to add Shadows to shapes
This can be done by adding a 'shadow' shape as the first shape in a multi-shape meter and using an Offset transformation parameter.Cariboudjan wrote: ↑August 19th, 2022, 9:40 pm I would love for there to be a simple way to add shadows to shapes with a "Shadow [X],[Y],[W],[H]" and "ShadowColor [Color],[Opacity]" parameter.
You can control the size, position, color, and opacity of the 'shadow' using variables or hard coded in the 'shadow' Shape definition.
The shapes will be drawn and layered according to the Shape# (bottom to topmost).
Note: Do Not use 'Combine' on the shape meter; this removes the attributes for additional numbered shapes.
A simple rectangle example with a shadow.
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Variables]
StrokeWidth=3
ShadowOffsetX=12
ShadowOffsetY=16
ShadowColor=0,40,0,80
[MeasureTime]
Measure=Time
Format=%H:%M
[Background]
Meter=Shape
; Offset the shapes to prevent clipping of the left & top strokes
X=(Ceil(#StrokeWidth#*0.5))
Y=(Ceil(#StrokeWidth#*0.5))
; Shadow Shape ~ matches background shape dimensions
Shape=Rectangle 0,0,240,120,20 | StrokeWidth 0 | Fill Color #ShadowColor# | Offset #ShadowOffsetX#,#ShadowOffsetY#
; Background Shape
Shape2=Rectangle 0,0,240,120,20 | StrokeWidth #StrokeWidth# | Stroke Color 255,255,255 | Fill Color 80,210,120,250
AntiAlias=1
[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=(240*0.5)
Y=(120*0.55)
FontSize=60
FontColor=255,255,255
StringAlign=CENTERCENTER
StringStyle=Bold
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 268
- Joined: May 12th, 2019, 8:55 am
Re: Suggestion: A simple way to add Shadows to shapes
Oh, I know - But you won't get the nice drop shadow blur effect. Currently there is no way to create a "fuzzy" stroke edge on a shape. A parameter that would allow you to add a shadow would be really useful, without any need to create a duplicate shape in a certain order.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Suggestion: A simple way to add Shadows to shapes
I agree that this method doesn't produce the best shadow effect and that you were probably already aware of thatCariboudjan wrote: ↑November 16th, 2022, 1:46 pm Oh, I know - But you won't get the nice drop shadow blur effect. Currently there is no way to create a "fuzzy" stroke edge on a shape. A parameter that would allow you to add a shadow would be really useful, without any need to create a duplicate shape in a certain order.
Hopefully, the DevTeam can take a look at your suggestion and give us a real shadow effect on shapes
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 2611
- Joined: March 23rd, 2015, 5:26 pm
Re: Suggestion: A simple way to add Shadows to shapes
You can do fuzzy shapes! It's kind of a lame work-around, but it works nearly perfectly. Just take that shadow, set it to black with the alpha set to something like -- I don't know -- say 16, or maybe 8. Then do overlapping background images offset by one pixel to the left and top. After a few overlaps, you'll have a pretty good shadow effect.Cariboudjan wrote: ↑November 16th, 2022, 1:46 pm Oh, I know - But you won't get the nice drop shadow blur effect. Currently there is no way to create a "fuzzy" stroke edge on a shape. A parameter that would allow you to add a shadow would be really useful, without any need to create a duplicate shape in a certain order.
Edit: Oops, I see where you said you don't want to do this. Sorry... It does work tho.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 268
- Joined: May 12th, 2019, 8:55 am
Re: Suggestion: A simple way to add Shadows to shapes
Neat trick!SilverAzide wrote: ↑November 16th, 2022, 7:45 pm You can do fuzzy shapes! It's kind of a lame work-around, but it works nearly perfectly. Just take that shadow, set it to black with the alpha set to something like -- I don't know -- say 16, or maybe 8. Then do overlapping background images offset by one pixel to the left and top. After a few overlaps, you'll have a pretty good shadow effect.
Edit: Oops, I see where you said you don't want to do this. Sorry... It does work tho.
Screenshot 2022-11-16 203058.png