Right. This is definitely possible without using images. And as said, it's much better and simpler to do it so.
If no one posts a sample, later today I'm gonna post one.
Right. This is definitely possible without using images. And as said, it's much better and simpler to do it so.
Alright, finally here is the promised code:
Code: Select all
[Variables]
Width=300
Clicks=0
[StringStyle]
Padding=15,5,15,5
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,1
FontFace=Segoe UI
StringAlign=CenterCenter
AntiAlias=1
DynamicVariables=1
[MeterButton]
Meter=Shape
X=2
Y=60
Shape=Rectangle 0,10,#Width#,50,10 | Extend MyModifiers1
Shape2=Rectangle 0,0,#Width#,50,10 | Extend MyModifiers2
MyModifiers1=Fill Color 26,113,193 | StrokeWidth 0 | Stroke Color 26,113,193,0
MyModifiers2=Fill Color 41,141,223 | StrokeWidth 0 | Stroke Color 41,141,223,0
LeftMouseDownAction=[!SetVariable Clicks "(#Clicks#+1)"][!SetOption MeterButton Shape2 "Rectangle 0,10,#Width#,50,10 | Extend MyModifiers2"][!SetOption MeterButtonLabel Y "([MeterButton:Y]+[MeterButton:H]/2+5)"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterButtonLabel"][!UpdateMeter "MeterResult"][!Redraw]
LeftMouseUpAction=[!SetOption MeterButton Shape2 "Rectangle 0,0,#Width#,50,10 | Extend MyModifiers2"][!SetOption MeterButtonLabel Y "([MeterButton:Y]+[MeterButton:H]/2-5)"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterButtonLabel"][!Redraw]
MouseLeaveAction=[!SetOption MeterButton Shape2 "Rectangle 0,0,#Width#,50,10 | Extend MyModifiers2"][!SetOption MeterButtonLabel Y "([MeterButton:Y]+[MeterButton:H]/2-5)"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterButtonLabel"][!Redraw]
DynamicVariables=1
[MeterButtonLabel]
Meter=STRING
MeterStyle=StringStyle
X=([MeterButton:X]+#Width#/2)
Y=([MeterButton:Y]+[MeterButton:H]/2-5)
FontColor=220,220,220
FontSize=12
StringStyle=BOLD
Text=Start Clicking
[MeterResult]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=24
FontColor=220,220,220
FontSize=40
Text=#Clicks#
[MeterReset]
Meter=STRING
MeterStyle=StringStyle
X=0r
Y=140
FontColor=26,113,193
FontSize=12
StringStyle=BOLD
Text=Reset
LeftMouseUpAction=[!SetVariable Clicks "0"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterResult"][!Redraw]
that lookss perfect! Niiice.balala wrote: ↑December 21st, 2020, 6:58 pm Alright, finally here is the promised code:Code: Select all
[Variables] Width=300 Clicks=0 [StringStyle] Padding=15,5,15,5 FontEffectColor=0,0,0 StringEffect=Shadow SolidColor=0,0,0,1 FontFace=Segoe UI StringAlign=CenterCenter AntiAlias=1 DynamicVariables=1 [MeterButton] Meter=Shape X=2 Y=60 Shape=Rectangle 0,10,#Width#,50,10 | Extend MyModifiers1 Shape2=Rectangle 0,0,#Width#,50,10 | Extend MyModifiers2 MyModifiers1=Fill Color 26,113,193 | StrokeWidth 0 | Stroke Color 26,113,193,0 MyModifiers2=Fill Color 41,141,223 | StrokeWidth 0 | Stroke Color 41,141,223,0 LeftMouseDownAction=[!SetVariable Clicks "(#Clicks#+1)"][!SetOption MeterButton Shape2 "Rectangle 0,10,#Width#,50,10 | Extend MyModifiers2"][!SetOption MeterButtonLabel Y "([MeterButton:Y]+[MeterButton:H]/2+5)"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterButtonLabel"][!UpdateMeter "MeterResult"][!Redraw] LeftMouseUpAction=[!SetOption MeterButton Shape2 "Rectangle 0,0,#Width#,50,10 | Extend MyModifiers2"][!SetOption MeterButtonLabel Y "([MeterButton:Y]+[MeterButton:H]/2-5)"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterButtonLabel"][!Redraw] MouseLeaveAction=[!SetOption MeterButton Shape2 "Rectangle 0,0,#Width#,50,10 | Extend MyModifiers2"][!SetOption MeterButtonLabel Y "([MeterButton:Y]+[MeterButton:H]/2-5)"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterButtonLabel"][!Redraw] DynamicVariables=1 [MeterButtonLabel] Meter=STRING MeterStyle=StringStyle X=([MeterButton:X]+#Width#/2) Y=([MeterButton:Y]+[MeterButton:H]/2-5) FontColor=220,220,220 FontSize=12 StringStyle=BOLD Text=Start Clicking [MeterResult] Meter=STRING MeterStyle=StringStyle X=0r Y=24 FontColor=220,220,220 FontSize=40 Text=#Clicks# [MeterReset] Meter=STRING MeterStyle=StringStyle X=0r Y=140 FontColor=26,113,193 FontSize=12 StringStyle=BOLD Text=Reset LeftMouseUpAction=[!SetVariable Clicks "0"][!UpdateMeter "MeterButton"][!UpdateMeter "MeterResult"][!Redraw]
I'm glad if you think so.
Glad to help, as always. Don't worry if you don't know how to achieve different things, just keep working, if you like Rainmeter. It's an exceptional piece of software and you gonna find a lot of very good solutions over time if you keep working.kathykiwn wrote: ↑January 14th, 2021, 10:12 am Thank you so much you all. I am a beginner and was trying to make a counter like this click counter . Tried searching on youtube and google but did not get anything. Finally, just because of you guys I made it. As a beginner, it's a huge achievement for me <3. Thank you all for the help especially balala.![]()
For this you have to write the current value of the Clicks variable to the [Variables] section. Just add a [!WriteKeyValue Variables Clicks "(#Clicks#+1)"] bang beside [!SetVariable Clicks "(#Clicks#+1)"], in the LeftMouseDownAction option of the [MeterButton] meter into my previously posted code.glass-houses wrote: ↑January 22nd, 2021, 7:57 am Hello, I am really grateful for this thread and to those who have replied. I would just like to ask if there is a way to retain the counter information regardless of refreshing or updating the skins? I sadly have little knowledge in coding and there's limited information I can find online on how to do this. I would very much appreciate your responses.
I see, thank you very much for the help!balala wrote: ↑January 22nd, 2021, 3:28 pm For this you have to write the current value of the Clicks variable to the [Variables] section. Just add a [!WriteKeyValue Variables Clicks "(#Clicks#+1)"] bang beside [!SetVariable Clicks "(#Clicks#+1)"], in the LeftMouseDownAction option of the [MeterButton] meter into my previously posted code.