It is currently April 27th, 2024, 8:44 am

Make a bar to move smoothly

Get help with creating, editing & fixing problems with skins
Arjun
Posts: 18
Joined: July 17th, 2023, 7:24 am

Make a bar to move smoothly

Post by Arjun »

There's a simple Bar meter which is based upon the Measure of CPU...I want that when on screen, this bar move like animated. I mean if CPU Percentage value drops from 100 to 50 then the bar should slowly and gradually decrease instead of directly jumping.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Make a bar to move smoothly

Post by eclectic-tech »

Arjun wrote: September 15th, 2023, 11:38 am There's a simple Bar meter which is based upon the Measure of CPU...I want that when on screen, this bar move like animated. I mean if CPU Percentage value drops from 100 to 50 then the bar should slowly and gradually decrease instead of directly jumping.
Add AverageSize=5 to the CPU measure. Modify the number to achieve the speed of change you want; higher numbers will make the transition slower.
Arjun
Posts: 18
Joined: July 17th, 2023, 7:24 am

Re: Make a bar to move smoothly

Post by Arjun »

Nah! Doesn't seems to work man
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Make a bar to move smoothly

Post by eclectic-tech »

Arjun wrote: September 16th, 2023, 11:40 am Nah! Doesn't seems to work man
You can also increase the skin update rate from once a second to 4 times a second by changing Update=1000 to Update=250 in the [Rainmeter] section.

This will speed up drawing the bar's new values and reduce the jumping of the bar every second.

Then use UpdateDivider on other measures that do not need a faster update rate to reduce CPU load.
See: Update Guide for more information.

Sample:

Code: Select all

; ========= Skin Settings ==========
[Rainmeter]
Update=250
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#


; ========= Measures ==========
[MeasureCPU]
Measure=CPU
; Processor=0
AverageSize=10
; UpdateDivider=


; ========= Meters ==========
[MeterBarBack]
Meter=Image
X=0
Y=0
W=180
H=20
SolidColor=47,47,47

[MeterBar]
Meter=Bar
MeasureName=MeasureCPU
X=0
Y=0
W=180
H=20
BarColor=0,255,0
BarOrientation=Horizontal
; Documentation: https://docs.rainmeter.net/manual-beta/meters/bar/

[MeterString]
Meter=String
MeasureName=MeasureCPU
X=2R
Y=2r
FontColor=255,255,255
Text=%1%
cpuslower.gif
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Make a bar to move smoothly

Post by Yincognito »

Another possibility that would make transitions as smooth as desired is using the ActionTimer plugin. Such a measure should transition from the previous value of the usage (presumably saved in a variable or measure) to the current one, can repeat the proper increment or decrement action accordingly and with a corresponding wait time between iterations, and would have to be commanded to stop and execute on each update or change of the usage measure:

https://docs.rainmeter.net/manual/plugins/actiontimer/

Note that the ActionList components like the number of repeats and the wait time between iterations would have to be precalculated since formulas are not allowed there. An alternative to precalculating would be to use fixed values for the number of repeats and the wait time (like, say, 30 and 25, respectively, for slightly less than 1 second, to give enough time for redrawing the skin in each action / iteration), and then compute the needed increment or decrement step to get from the previous usage value to the current one in the action itself.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Arjun
Posts: 18
Joined: July 17th, 2023, 7:24 am

Re: Make a bar to move smoothly

Post by Arjun »

Thanks Eclectic-Tech dude...the idea made the transition somehow smoother....
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Make a bar to move smoothly

Post by CodeCode »

Arjun wrote: September 17th, 2023, 7:49 am Thanks Eclectic-Tech dude...the idea made the transition somehow smoother....
Well, the somehow is due to the values changing faster than once per second. So increasing the amount of updates per second i.e. skin updating in less than 1000 millicycles per second.

Making that change will also smooth out animations in skins like visualizers. Referenced by the base updates in almost any visualizer pre-made by someone else.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.