It is currently April 24th, 2024, 10:48 am
How to display UI items in set intervals
-
- Posts: 4
- Joined: January 5th, 2022, 10:23 pm
How to display UI items in set intervals
I'd like to use the clock overlay to help me keep track of time while I play games. However, I dont want to constantly see the clock at all times. Is there a way I could set the clock to unhide itself every 10 minutes , slowly display itself for 10 seconds, then slowly rehide itself until the next 10 minutes?
-
- Rainmeter Sage
- Posts: 16164
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to display UI items in set intervals
There is for sure. Here is an example. The basic idea is to have a measure which increments from 0 to a variable value (different when the clock is shown and when it is hidden), then act accordingly. See for instance the following code:TheDrifter76 wrote: ↑January 5th, 2022, 10:32 pm I'd like to use the clock overlay to help me keep track of time while I play games. However, I dont want to constantly see the clock at all times. Is there a way I could set the clock to unhide itself every 10 minutes , slowly display itself for 10 seconds, then slowly rehide itself until the next 10 minutes?
Code: Select all
[Rainmeter]
Update=1000
[Variables]
HiddenInterval=600
ShownInterval=10
Interval=#ShownInterval#
[MeasureTime]
Measure=Time
Format=%#H:%M:%S
[MeasureInterval]
Measure=Calc
Formula=(( MeasureInterval + 1 ) % #Interval# )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetVariable Interval "((#Interval#=#ShownInterval#)?#HiddenInterval#:#ShownInterval#)"][!ToggleFade]
DynamicVariables=1
[MeterTime]
Meter=STRING
MeasureName=MeasureTime
X=0
Y=0
Padding=25,15,25,15
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=28
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
- HiddenInterval is the number of seconds while the skin will be hidden.
- ShownInterval is obviously the number of seconds while the skin will be shown.
- Don't change the Interval variable.
The skin starts shown. After a number of seconds equal to ShownInterval, you get it hidden. After a time equal with HiddenInterval, you get it shown. And so on. Just make sure to properly set the ShownInterval and HiddenInterval variables.
And one more you have to know: if you want to show the skin over a full-screen game, you have to set it Always on top. If you don't know how to do this, please let me know.
-
- Posts: 4
- Joined: January 5th, 2022, 10:23 pm
Re: How to display UI items in set intervals
So i just copy paste the code anywhere in the skin?
also, I see a "stay topmost" option, but no, I dont know how to do "always on top" option
also, I see a "stay topmost" option, but no, I dont know how to do "always on top" option
-
- Rainmeter Sage
- Posts: 16164
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to display UI items in set intervals
Do you have a skin? If you have one, yep, paste ther code into that and refresh the skin. If you don't have, do the followings:TheDrifter76 wrote: ↑January 7th, 2022, 5:41 am So i just copy paste the code anywhere in the skin?
also, I see a "stay topmost" option, but no, I dont know how to do "always on top" option
- Create a new skin. Here is how can you do this.
- Copy - paste the above posted code into the new skin's .ini file. Save and refresh the skin.
- Now it should do what is expected to do: show the clock for a time equal to ShownInterval, then hide it for a period equal to HiddenInterval. Then the process resumes, going on again and again.
-
- Posts: 4
- Joined: January 5th, 2022, 10:23 pm
Re: How to display UI items in set intervals
since I've pasted the code, I havn't seen the clock once. Did I do it right? (using ScrollTime btw)
Code: Select all
[rainmeter]
Author= Manuel Vrhovac (manci5.deviantart.com)
update=1000
[Metadata]
Name=
Author=
Information=
License=
Version=
[variables]
; Do you want animated hours too?
AnimatedHours=0
AnimatedMinutes=1
; MyriadPro or LucidaGrande font?
Font=MyriadPro
; Dark or Light shadow?
Shadow=Dark
position1=11
position2=113
yposition1=10
yposition2=10
offset=[hoursformula]
[hour]
measure=time
format=%I
[seconds]
measure=time
format=%S
[minutes]
measure=time
format=%M
[houroffset]
measure=calc
formula=minutes*0.58
[hoursformula]
measure=calc
formula=(hour*(-70))+54-(houroffset*#animatedhours#)
[minutesformula]
measure=calc
formula=4+minutes*(-70)+(((seconds-30)*(-1.16)+35)*#animatedminutes#)+#yposition2#
[offsety]
measure=calc
formula=120-(hour*(-70))+(houroffset*#animatedhours#)
[offsety2]
measure=calc
formula=-1*minutesformula+160+#yposition2#
[meterbackground]
meter=image
imagename=background.png
x=#position1#
y=#yposition1#
[meterbackground2]
meter=image
imagename=background.png
x=#position2#
y=#yposition2#
[glasshours]
meter=image
imagename=glass.png
X=(#position1#-1)
Y=#yposition1#
[glassminutes]
meter=image
X=(#position2#-1)
y=#yposition2#
imagename=glass.png
[numbers12]
meter=image
imagename=#font#.png
x=(#position1#-5)
y=[hoursformula]
dynamicvariables=1
imagecrop=0,0,100,[offsety]
[numbersminutes]
meter=image
imagename=#font#minutes.png
x=#position2#
y=[minutesformula]
dynamicvariables=1
imagecrop=0,100,100,[offsety2]
[frame]
meter=image
imagename=frame.png
x=0
y=0
[string]
meter=string
measurename=offsety2
y=170
fontsize=20
antialias=1
hidden=1
[shadowhours]
meter=image
imagename=shadow#shadow#.png
x=#position1#
y=#yposition1#
[shadowminutes]
meter=image
x=#position2#
y=#yposition2#
imagename=shadow#shadow#.png
[glasshoursover]
meter=image
imagename=glassover.png
X=(#position1#-1)
Y=#yposition1#
[glassminutesover]
meter=image
X=(#position2#-1)
y=#yposition2#
imagename=glassover.png
[Rainmeter]
Update=1000
[Variables]
HiddenInterval=5
ShownInterval=60
Interval=#ShownInterval#
[MeasureTime]
Measure=Time
Format=%#H:%M:%S
[MeasureInterval]
Measure=Calc
Formula=(( MeasureInterval + 1 ) % #Interval# )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetVariable Interval "((#Interval#=#ShownInterval#)?#HiddenInterval#:#ShownInterval#)"][!ToggleFade]
DynamicVariables=1
[MeterTime]
Meter=STRING
MeasureName=MeasureTime
X=0
Y=0
Padding=25,15,25,15
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=28
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
-
- Posts: 246
- Joined: July 8th, 2021, 11:30 pm
- Location: The King's Avenue, Golden Kingdom
Re: How to display UI items in set intervals
Okay. Do this. Open your skin in the text editor, press CTRL+A then BACKSPACE (I mean, delete everything). Now, copy what is down here and paste it in the skin and SAVE it. Refresh Rainmeter and it will start working.TheDrifter76 wrote: ↑January 15th, 2022, 4:48 pm since I've pasted the code, I havn't seen the clock once. Did I do it right? (using ScrollTime btw)Code: Select all
[rainmeter] Author= Manuel Vrhovac (manci5.deviantart.com) update=1000 [Metadata] Name= Author= Information= License= Version= [variables] ; Do you want animated hours too? AnimatedHours=0 AnimatedMinutes=1 ; MyriadPro or LucidaGrande font? Font=MyriadPro ; Dark or Light shadow? Shadow=Dark position1=11 position2=113 yposition1=10 yposition2=10 offset=[hoursformula] [hour] measure=time format=%I [seconds] measure=time format=%S [minutes] measure=time format=%M [houroffset] measure=calc formula=minutes*0.58 [hoursformula] measure=calc formula=(hour*(-70))+54-(houroffset*#animatedhours#) [minutesformula] measure=calc formula=4+minutes*(-70)+(((seconds-30)*(-1.16)+35)*#animatedminutes#)+#yposition2# [offsety] measure=calc formula=120-(hour*(-70))+(houroffset*#animatedhours#) [offsety2] measure=calc formula=-1*minutesformula+160+#yposition2# [meterbackground] meter=image imagename=background.png x=#position1# y=#yposition1# [meterbackground2] meter=image imagename=background.png x=#position2# y=#yposition2# [glasshours] meter=image imagename=glass.png X=(#position1#-1) Y=#yposition1# [glassminutes] meter=image X=(#position2#-1) y=#yposition2# imagename=glass.png [numbers12] meter=image imagename=#font#.png x=(#position1#-5) y=[hoursformula] dynamicvariables=1 imagecrop=0,0,100,[offsety] [numbersminutes] meter=image imagename=#font#minutes.png x=#position2# y=[minutesformula] dynamicvariables=1 imagecrop=0,100,100,[offsety2] [frame] meter=image imagename=frame.png x=0 y=0 [string] meter=string measurename=offsety2 y=170 fontsize=20 antialias=1 hidden=1 [shadowhours] meter=image imagename=shadow#shadow#.png x=#position1# y=#yposition1# [shadowminutes] meter=image x=#position2# y=#yposition2# imagename=shadow#shadow#.png [glasshoursover] meter=image imagename=glassover.png X=(#position1#-1) Y=#yposition1# [glassminutesover] meter=image X=(#position2#-1) y=#yposition2# imagename=glassover.png [Rainmeter] Update=1000 [Variables] HiddenInterval=5 ShownInterval=60 Interval=#ShownInterval# [MeasureTime] Measure=Time Format=%#H:%M:%S [MeasureInterval] Measure=Calc Formula=(( MeasureInterval + 1 ) % #Interval# ) IfCondition=(#CURRENTSECTION#=0) IfTrueAction=[!SetVariable Interval "((#Interval#=#ShownInterval#)?#HiddenInterval#:#ShownInterval#)"][!ToggleFade] DynamicVariables=1 [MeterTime] Meter=STRING MeasureName=MeasureTime X=0 Y=0 Padding=25,15,25,15 FontColor=220,220,220 FontEffectColor=0,0,0 StringEffect=Shadow SolidColor=0,0,0,150 FontSize=28 FontFace=Segoe UI StringStyle=BOLD StringAlign=LEFT AntiAlias=1 Text=%1
Code: Select all
[rainmeter]
Author= Manuel Vrhovac (manci5.deviantart.com)
update=1000
[Metadata]
Name=
Author=
Information=
License=
Version=
[variables]
; Do you want animated hours too?
AnimatedHours=0
AnimatedMinutes=1
; MyriadPro or LucidaGrande font?
Font=MyriadPro
; Dark or Light shadow?
Shadow=Dark
position1=11
position2=113
yposition1=10
yposition2=10
offset=[hoursformula]
HiddenInterval=5
ShownInterval=60
Interval=#ShownInterval#
[hour]
measure=time
format=%I
[seconds]
measure=time
format=%S
[minutes]
measure=time
format=%M
[houroffset]
measure=calc
formula=minutes*0.58
[hoursformula]
measure=calc
formula=(hour*(-70))+54-(houroffset*#animatedhours#)
[minutesformula]
measure=calc
formula=4+minutes*(-70)+(((seconds-30)*(-1.16)+35)*#animatedminutes#)+#yposition2#
[offsety]
measure=calc
formula=120-(hour*(-70))+(houroffset*#animatedhours#)
[offsety2]
measure=calc
formula=-1*minutesformula+160+#yposition2#
[meterbackground]
meter=image
imagename=background.png
x=#position1#
y=#yposition1#
[meterbackground2]
meter=image
imagename=background.png
x=#position2#
y=#yposition2#
[glasshours]
meter=image
imagename=glass.png
X=(#position1#-1)
Y=#yposition1#
[glassminutes]
meter=image
X=(#position2#-1)
y=#yposition2#
imagename=glass.png
[numbers12]
meter=image
imagename=#font#.png
x=(#position1#-5)
y=[hoursformula]
dynamicvariables=1
imagecrop=0,0,100,[offsety]
[numbersminutes]
meter=image
imagename=#font#minutes.png
x=#position2#
y=[minutesformula]
dynamicvariables=1
imagecrop=0,100,100,[offsety2]
[frame]
meter=image
imagename=frame.png
x=0
y=0
[string]
meter=string
measurename=offsety2
y=170
fontsize=20
antialias=1
hidden=1
[shadowhours]
meter=image
imagename=shadow#shadow#.png
x=#position1#
y=#yposition1#
[shadowminutes]
meter=image
x=#position2#
y=#yposition2#
imagename=shadow#shadow#.png
[glasshoursover]
meter=image
imagename=glassover.png
X=(#position1#-1)
Y=#yposition1#
[glassminutesover]
meter=image
X=(#position2#-1)
y=#yposition2#
imagename=glassover.png
[MeasureInterval]
Measure=Calc
Formula=(( MeasureInterval + 1 ) % #Interval# )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetVariable Interval "((#Interval#=#ShownInterval#)?#HiddenInterval#:#ShownInterval#)"][!ToggleFade]
DynamicVariables=1
the DA GALLERY For some Reason, the square root of X2 does not involve X
-
- Rainmeter Sage
- Posts: 16164
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to display UI items in set intervals
What have you missed and has been fixed by David8192 above, is the HiddenInterval, ShownInterval and Interval variables within the [Variables] section, which have been forgotten. Add them to the code and the skin will start properly working:TheDrifter76 wrote: ↑January 15th, 2022, 4:48 pm since I've pasted the code, I havn't seen the clock once. Did I do it right? (using ScrollTime btw)
Code: Select all
[Variables]
...
HiddenInterval=600
ShownInterval=10
Interval=#ShownInterval#
Additional note: even if this is not extremely important (and this is related to both, your and David8192's code), note that the Author option doesn't belong anymore to the [Rainmeter] section, but to [Metadata]. Even if a while ago it was there, it has been deprecated in this section. Yep, using / adding it to [Rainmeter] doesn't create problems, however strictly speaking, it should be used on the [Metadata] section. In both codes there is an Author option on [Metadata], but this is empty, while the Author on [Rainmeter] section is completed. Again, not a too important thing, however...
-
- Posts: 246
- Joined: July 8th, 2021, 11:30 pm
- Location: The King's Avenue, Golden Kingdom
Re: How to display UI items in set intervals
Sure thing. I kinda overlooked it, but you are right. It's good practice to put it in the right section.balala wrote: ↑January 16th, 2022, 11:01 am Additional note: even if this is not extremely important (and this is related to both, your and David8192's code), note that the Author option doesn't belong anymore to the [Rainmeter] section, but to [Metadata]. Even if a while ago it was there, it has been deprecated in this section. Yep, using / adding it to [Rainmeter] doesn't create problems, however strictly speaking, it should be used on the [Metadata] section. In both codes there is an Author option on [Metadata], but this is empty, while the Author on [Rainmeter] section is completed. Again, not a too important thing, however...
the DA GALLERY For some Reason, the square root of X2 does not involve X
-
- Rainmeter Sage
- Posts: 16164
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to display UI items in set intervals
Right, even if has not too much importance, as said.
-
- Posts: 4
- Joined: January 5th, 2022, 10:23 pm
Re: How to display UI items in set intervals
Right, It works now. Thank you both very much!