If you use code like this:xames3 wrote:Guys thanks for your help it is working though but the animation doesn't stops on last frame. I want the animation to run once every refresh/loading and the last frame should stay in place.
Also can some please explain the executions of the above code? That would be helpful for me to learn and understand future codes even better.
Thanks in advance!
And just replace the dummy String meter I have with your Bitmap meter, it should work.
Code: Select all
[Rainmeter] Update=1000 DynamicWindowSize=1 AccurateText=1 OnRefreshAction=[!CommandMeasure MeasureAction "Execute 1"] [MeasureCount] Measure=Loop StartValue=1 EndValue=135 UpdateDivider=-1 Paused=1 [MeasureAction] Measure=Plugin Plugin=ActionTimer ActionList1=Start | Wait 10 | Repeat CountUp,16,135 | Wait 10 | Stop Start=[!UnpauseMeasure MeasureCount] CountUp=[!UpdateMeasure MeasureCount][!UpdateMeter MeterCount][!Redraw] Stop=[!PauseMeasure MeasureCount] [MeterCount] Meter=String MeasureName=MeasureCount FontSize=15 FontWeight=400 FontColor=255,255,255,255 SolidColor=47,47,47,255 Padding=5,5,5,5 AntiAlias=1
What it is doing is:
1) The skins starts with the Loop measure [MeasureCount] "paused". That means it will have its initial value "1", but won't update any further while it is paused. It also has UpdateDivider=-1, which means that even once it is unpaused, it will only update once and stop.
2) Then when the skin is loaded or refreshed, the OnRefreshAction will fire the ActionTimer measure [MeasureAction].
3) That measure will do the following:
a) Unpause the Loop measure.
b) Force an update to the Loop measure, then update the meter and redraw the skin. That will cause the meter to use the value of the Loop measure as the "frame" of the Bitmap. Repeat that 135 times, with a "wait" of 16ms between each time.
c) Pause the Loop measure again, so it will stay at the "last" value it has.
So when the skin is loaded or refreshed, it will count from 1 to 135 at 16ms intervals, and force the frame of the bitmap to that number. Then it will leave that last bitmap frame in place, and just sorta idle at an Update of 1000. I don't know what if anything else you might have the skin doing, but unless you also need them to update faster than once a second, there is no benefit to using resources to drive this one-time animation.