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

Interesting clipping going on with string meter

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Interesting clipping going on with string meter

Post by jsmorley »

Maybe both the background and the container...

Code: Select all

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

[Metadata]
Name=
Author=Wodger
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
FontSizeSet=80
FaderColor=255,255,255,1
FaderLengthStart=0
FaderLengthEnd=0
FaderValue=0.5
SelectedMeterLaunch=MeterLaunch1
U=[!UpdateMeasure MeasureHoverBarReveal][!UpdateMeter MeterLaunchBar][!Redraw]

[MeterContainer]
Meter=Image
W=547
H=151
SolidColor=0,0,0,255

[MeterBackground]
Meter=Image
W=555
H=151
SolidColor=150,100,100,50

[MeterLaunch1]
Meter=String
Text=Online Drives
AntiAlias=1
FontColor=255,255,255
FontFace=Norican
FontSize=#FontSizeSet#
MouseOverAction=[!SetVariable SelectedMeterLaunch "MeterLaunch1"][!CommandMeasure MeasureHoverBarReveal "Stop 2"][!CommandMeasure MeasureHoverBarReveal "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureHoverBarReveal "Stop 1"][!CommandMeasure MeasureHoverBarReveal "Execute 2"]
DynamicVariables=1
Container=MeterContainer

[MeterLaunchBar]
Meter=Shape
Shape=Path RightBar | StrokeWidth 0 | Fill Color #FaderColor#
RightBar=([#SelectedMeterLaunch#:W]/2),([#SelectedMeterLaunch#:H]-[#SelectedMeterLaunch#:H]/15) | LineTo (([#SelectedMeterLaunch#:W]/2)+15)*#FaderValue#,([#SelectedMeterLaunch#:H]-[#SelectedMeterLaunch#:H]/15) | LineTo ([#SelectedMeterLaunch#:W])*#FaderValue#,([#SelectedMeterLaunch#:H]-[#SelectedMeterLaunch#:H]/15) | ArcTo ([#SelectedMeterLaunch#:W]*#FaderValue#),([#SelectedMeterLaunch#:H]) | LineTo ([#SelectedMeterLaunch#:W]/2),([#SelectedMeterLaunch#:H]), ClosePath=1
;Shape2=Path LeftBar | StrokeWidth 0 | Fill Color #FaderColor#
;LeftBar=([#SelectedMeterLaunch#:W]/2),([#SelectedMeterLaunch#:H]-[#SelectedMeterLaunch#:H]/15) | LineTo 10,([#SelectedMeterLaunch#:H]-[#SelectedMeterLaunch#:H]/15) | ArcTo 10,([#SelectedMeterLaunch#:H]),*,*,*,1 | LineTo ([#SelectedMeterLaunch#:W]/2),([#SelectedMeterLaunch#:H]), ClosePath=1
DynamicVariables=1

[MeasureHoverBarReveal]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Reveal,10,10
Reveal=[!SetVariable FaderValue "(Clamp(#FaderValue#+0.05,0.5,1))"]#U#
ActionList2=Repeat Hide,10,10
Hide=[!SetVariable FaderValue "(Clamp(#FaderValue#-0.05,0.5,1))"]#U#
IfCondition=(#FaderValue#=0.5)
IfTrueAction=[!SetVariable FaderColor "255,255,255,1"]
IfCondition2=(#FaderValue#>0.5)
IfTrueAction2=[!SetVariable FaderColor "255,255,255,100"]
DynamicVariables=1

1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
wodger1912
Posts: 4
Joined: June 15th, 2020, 4:24 pm

Re: Interesting clipping going on with string meter

Post by wodger1912 »

Was experimenting with containers earlier before I had to drop everything quickly and head out with the Mrs. I will have another look this PM and will post back on progress - Thanks v.much for your thoughts and code examples, it makes learning very much easier (container experiments before I left were making everything disappear :Whistle )
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Interesting clipping going on with string meter

Post by Yincognito »

jsmorley wrote: June 15th, 2020, 8:49 pmEverything else seems ok. Just the SolidColor container of the meter isn't being made large enough. SkinWidth won't help, Padding won't help, I think you need a separate background meter.
I use drawing an invisible copy of the chars / text to have a precise estimate of the width of a string, before drawing the actual text with the corresponding color. Maybe it can be used here as well to estimate the "true width" of the text (taking the embellishment into account)?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth