It is currently May 26th, 2024, 11:39 pm

blinking dot

Get help with installing and using Rainmeter.
rmsds
Posts: 7
Joined: January 23rd, 2023, 1:39 pm

blinking dot

Post by rmsds »

Hello friends,

i need a blinking dot, 10x10, red.

Thank u.
User avatar
balala
Rainmeter Sage
Posts: 16262
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: blinking dot

Post by balala »

rmsds wrote: July 29th, 2023, 12:31 am i need a blinking dot, 10x10, red.
Did you try creating it? How?
Sorry, but no one will create it for you. But if you gave it a try, we'll help you to do it in the way you want. So, have you a starting code?
rmsds
Posts: 7
Joined: January 23rd, 2023, 1:39 pm

Re: blinking dot

Post by rmsds »

Sure. Currently, my code looks like this:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[MeasureToggle]
Measure=Calc
Formula=(MeasureToggle + 1) % 2
MinValue=0
MaxValue=1
OnChangeAction=[!UpdateMeterGroup BlinkGroup]

[MeterDot]
Meter=Shape
MeasureName=MeasureToggle
Shape=Ellipse 0,0,10,10
X=(#SCREENAREAWIDTH# - 10) / 2
Y=(#SCREENAREAHEIGHT# - 10) / 2
SolidColor=255,0,0
DynamicVariables=1

[MeterHidden]
Meter=String
MeasureName=MeasureToggle
Hidden=1

[Metadata]
Name=Blinkender Punkt
Author=rmsds
Information=Ein blinkender roter Punkt.
User avatar
balala
Rainmeter Sage
Posts: 16262
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: blinking dot

Post by balala »

rmsds wrote: July 29th, 2023, 8:13 am Sure. Currently, my code looks like this:
Alright. I assume [MeterDot] is the meter which should blinking, right?
If this is right, you can do this in more ways. One of them is to use an IfCondition on the [MeasureToggle] measure, which should show the [MeterDot] meter when the value of [MeasureToggle] is 1 and hide it when the value is 0. So, add the following options to the [MeasureToggle] measure:

Code: Select all

[MeasureToggle]
...
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ShowMeter "MeterDot"][!Redraw]
IfFalseAction=[!HideMeter "MeterDot"][!Redraw]
Don't alter or remove any of the existing options, just add these ones.
What these options are doing, is that when the set condition is true (so when [MeasureToggle] is 1), IfTrueAction is executed. The [!ShowMeter "MeterDot"] bang shows the [MeterDot] meter. When the condition is not met (so when [MeasureToggle] is 0), IfFalseAction is executed, hiding the meter.
Is this what you want? There are other ways to achieve what you asked for, but I think this is the easiest one.
rmsds
Posts: 7
Joined: January 23rd, 2023, 1:39 pm

Re: blinking dot

Post by rmsds »

Wonderful. Thank you very much. That's exactly how I imagined it. :welcome: I just don't understand why the dot remains white even though I specified the color as 255,0,0.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1


[MeasureToggle]
Measure=Calc
Formula=(MeasureToggle + 1) % 2
MinValue=0
MaxValue=1
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ShowMeter "MeterDot"][!Redraw]
IfFalseAction=[!HideMeter "MeterDot"][!Redraw]

OnChangeAction=[!UpdateMeterGroup BlinkGroup]

[MeterDot]
Meter=Shape
MeasureName=MeasureToggle
Shape=Ellipse 20,20,20,20
X=(#SCREENAREAWIDTH# - 0) / 2
Y=(#SCREENAREAHEIGHT# - 0) / 2
SolidColor=255,0,0
DynamicVariables=1

[MeterHidden]
Meter=String
MeasureName=MeasureToggle
Hidden=1

[Metadata]
Name=Blinkender Punkt
Author=IhrName
Information=Ein blinkender roter Punkt.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5418
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: blinking dot

Post by eclectic-tech »

To set a SHAPE meter color, you need to define the color in the Shape pameters; setting a SOLIDCOLOR option on a shape meter only changes the color outside of the defined shape.

Change the code for your [MeterDot] to this:

Code: Select all

[MeterDot]
Meter=Shape
MeasureName=MeasureToggle
Shape=Ellipse 20,20,20,20 | Fill Color 255,0,0
X=(#SCREENAREAWIDTH# - 0) / 2
Y=(#SCREENAREAHEIGHT# - 0) / 2
DynamicVariables=1

I removed the SolidColor=255,0,0 from the code and added a Fill Color 255,0,0 parameter to set the shape internal color value.

See more about SHAPE meter modifier attributes.
rmsds
Posts: 7
Joined: January 23rd, 2023, 1:39 pm

Re: blinking dot

Post by rmsds »

:thumbup: Very nice. That's what i wont. Thank you very much.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5418
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: blinking dot

Post by eclectic-tech »

Happy to help!
Shape meters are one of most useful but complicated meter; keep experimenting and it will get easier to find solutions :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16262
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: blinking dot

Post by balala »

rmsds wrote: July 29th, 2023, 11:24 am I just don't understand why the dot remains white even though I specified the color as 255,0,0.
Why that shape has been white (and ecelectic-tech didn't mention this) is because the default fill color of Shape meters (the one defined by the Fill Color parameter, as mentioned by eclectic-tech) is white (255,255,255,255). If you don't add a specific Fill Color parameter, the white default color is used.