It is currently May 19th, 2022, 4:01 pm

Image Change Via Time?

General topics related to Rainmeter.
User avatar
MourningStar
Posts: 247
Joined: June 12th, 2016, 2:40 am

Image Change Via Time?

Post by MourningStar »

Hi All - :)

If possible I will create post in Skins Help forum. I will use a weather skin for an example. Can a skin be configured to display a sun image for, say, 06:00 to 18:00 and a moon image for 18:01 to 05:59?

-thx
User avatar
balala
Rainmeter Sage
Posts: 14209
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image Change Via Time?

Post by balala »

MourningStar wrote: May 14th, 2022, 5:02 pm Can a skin be configured to display a sun image for, say, 06:00 to 18:00 and a moon image for 18:01 to 05:59?
It definitely is. You need a Time measure, with a proper IfCondition. For instance:

Code: Select all

[MeasureTime]
Measure=Time
Format=%#H
IfCondition=((#CURRENTSECTION#>=6)&&(#CURRENTSECTION#<18))
IfTrueAction=[!SetOption MeterImage ImageName "#@#SunImage"][!UpdateMeter "MeterImage"][!Redraw]
IfFalseAction=[!SetOption MeterImage ImageName "#@#MoonImage"][!UpdateMeter "MeterImage"][!Redraw]
The !SetOption bangs are setting the appropriate image to an Image meter, called [MeterImage]. Take care to modify the bangs in a way to have the proper meter and image names.
User avatar
MourningStar
Posts: 247
Joined: June 12th, 2016, 2:40 am

Re: Image Change Via Time?

Post by MourningStar »

thank you balala - is there a skin that does this so I may study the code and see if I can create this functionality with one of mine on my own?
User avatar
balala
Rainmeter Sage
Posts: 14209
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image Change Via Time?

Post by balala »

MourningStar wrote: May 14th, 2022, 8:31 pm is there a skin that does this so I may study the code and see if I can create this functionality with one of mine on my own?
There probably is (in fact for sure is), but I can't recommend one. But starting from the posted code, you can modify it as you want or you can come back if further questions arise.
User avatar
MourningStar
Posts: 247
Joined: June 12th, 2016, 2:40 am

Re: Image Change Via Time?

Post by MourningStar »

ok, I will go for it! :great: