It is currently March 28th, 2024, 10:28 am

Fade in/out effect on value change?

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
srkian19
Posts: 3
Joined: August 11th, 2018, 12:31 pm
Location: India
Contact:

Fade in/out effect on value change?

Post by srkian19 »

Hi! I want to make skin with fade in/out effect on value change (like clock hour, mlinutes, quote of the day). How? :(
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fade in/out effect on value change?

Post by jsmorley »

The best, and maybe only, way to do it is to have an OnChangeAction on whatever measure is getting the value trigger an ActionTimer plugin measure that changes the alpha value of the visible element.

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

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure MeasureFadeTime "Execute 1"][!CommandMeasure MeasureFadeTime "Execute 2"][!CommandMeasure MeasureFadeTime "Execute 3"]

[Variables]
W=20
U=[!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw]
MinuteAlpha=255
HourAlpha=255

[MeasureHour]
Measure=Time
Format=%#I
OnChangeAction=[!CommandMeasure MeasureFadeTime "Execute 1"]

[MeasureMinute]
Measure=Time
Format=%M
OnChangeAction=[!CommandMeasure MeasureFadeTime "Execute 2"]

[MeasureSecond]
Measure=Time
Format=%S
OnChangeAction=[!CommandMeasure MeasureFadeTime "Execute 3"]

[MeasureAMPM]
Measure=Time
Format=%p

[MeasureFadeTime]
Measure=Plugin
Plugin=ActionTimer
Group=Faders
; Hours
ActionList1=SetHoursTo1|Wait #W#|Repeat SetHoursCalc, #W#, 13
SetHoursTo1=[!SetVariable HourAlpha "1"]#U#
SetHoursCalc=[!SetVariable HourAlpha "(Min(#HourAlpha#+20,255))"]#U#
; Minutes
ActionList2=SetMinutesTo1|Wait #W#|Repeat SetMinutesCalc, #W#, 13
SetMinutesTo1=[!SetVariable MinuteAlpha "1"]#U#
SetMinutesCalc=[!SetVariable MinuteAlpha "(Min(#MinuteAlpha#+20,255))"]#U#
; Seconds
ActionList3=SetSecondsTo1|Wait #W#|Repeat SetSecondsCalc, #W#, 13
SetSecondsTo1=[!SetVariable SecondAlpha "1"]#U#
SetSecondsCalc=[!SetVariable SecondAlpha "(Min(#SecondAlpha#+20,255))"]#U#
DynamicVariables=1

[MeterHour]
Meter=String
MeasureName=MeasureHour
Group=Faders
FontSize=70
FontColor=255,255,255,#HourAlpha#
SolidColor=0,0,0,1
AntiAlias=1
UpdateDivider=-1
DynamicVariables=1

[MeterColon]
Meter=String
X=R
FontSize=70
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=:

[MeterMinute]
Meter=String
MeasureName=MeasureMinute
Group=Faders
X=R
FontSize=70
FontColor=255,255,255,#MinuteAlpha#
SolidColor=0,0,0,1
AntiAlias=1
UpdateDivider=-1
DynamicVariables=1

[MeterAMPM]
Meter=String
MeasureName=MeasureAMPM
X=42R
Y=13
FontSize=15
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterSecond]
Meter=String
MeasureName=MeasureSecond
Group=Faders
X=-31r
Y=31
FontSize=44
FontColor=255,255,255,#SecondAlpha#
SolidColor=0,0,0,1
AntiAlias=1
UpdateDivider=-1
DynamicVariables=1
GIF.gif
Note that this is actually a visual "trick", in that it doesn't fade "out" anything at all, but simply instantly changes the "old" value to invisible, and starts fading "in" the "new" value. However, due to "persistence of vision", your mind tells you that that the old version fades out. To get a true fade out / fade in effect would be very complicated indeed, as you would have to keep track of both the old and new values, and would likely need to play some kind of hideous "shell game" with two distinct versions of the meters. As soon as the OnChangeAction is triggered, the "old" value no longer exists...
User avatar
srkian19
Posts: 3
Joined: August 11th, 2018, 12:31 pm
Location: India
Contact:

Re: Fade in/out effect on value change?

Post by srkian19 »

Thanks! How to use it for Quote of the day?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fade in/out effect on value change?

Post by jsmorley »

srkian19 wrote:Thanks! How to use it for Quote of the day?
Same way, it doesn't really matter which "visual element" you change when the value of a measure changes. You are really just changing a variable for the alpha value, which the meter in question uses.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fade in/out effect on value change?

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure MeasureFadeQuote "Execute 1"]

[Variables]
W=20
U=[!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw]
QuoteAlpha=255

[MeasureRandomQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#@#PithyMeter.txt
UpdateDivider=5
OnChangeAction=[!CommandMeasure MeasureFadeQuote "Execute 1"]

[MeasureFadeQuote]
Measure=Plugin
Plugin=ActionTimer
Group=Faders
DynamicVariables=1
ActionList1=SetAlphaTo1|Wait #W#|Repeat SetAlphaCalc, #W#, 13
SetAlphaTo1=[!SetVariable QuoteAlpha "1"]#U#
SetAlphaCalc=[!SetVariable QuoteAlpha "(Min(#QuoteAlpha#+20,255))"]#U#

[MeterChar]
Meter=String
FontSize=60
FontColor=255,255,255,255
FontWeight=400
AntiAlias=1
Text=[\x201C]

[MeterQuote]
Meter=String
Group=Faders
MeasureName=MeasureRandomQuote
X=10R
Y=10r
W=300
ClipString=2
FontSize=25
FontWeight=400
FontColor=255,255,255,#QuoteAlpha#
SolidColor=0,0,0,1
DynamicVariables=1
AntiAlias=1
PithyMeter.txt

Code: Select all

42.7 percent of all statistics are made up on the spot.
99 percent of lawyers give the rest a bad name.
A bore is a man who deprives you of solitude without providing you with company.
A closed mouth gathers no foot.
A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila.
A conclusion is simply the place where you got tired of thinking.
A crisis is when you can't say "Let's forget the whole thing." 
A day without sunshine is like, night.
A diplomat is someone who can tell you to go to hell in such a way that you will look forward to the trip.
A flashlight is a case for holding dead batteries.
A live plowhorse is still better than a dead thoroughbred. 
A ship in the harbor is safe, but that is not what ships were made for.
A single fact can spoil a good argument.
Age and Treachery Will Always Overcome Youth and Skill
All extremists should be taken out and shot.
All generalizations are false, including this one.
All jobs require you to do things you'd rather not do. That's why they have to pay you.
All software is bug-free, assuming sufficiently clever definitions of "feature" and "expected behaviour".
An honest politician is one who, when he is bought, will stay bought.
An ID card is solely for the purpose of allowing the government to compel you to produce it.
And whose cruel idea was it for the word "Lisp" to have a "S" in it?
Any sufficiently advanced incompetence is indistinguishable from malice.
Any sufficiently advanced technology is indistinguishable from magic. 
Anybody who wants the presidency so much that he'll spend two years organizing and campaigning for it is not to be trusted with the office.
Anything worth taking seriously is worth making fun of.
Artificial Intelligence usually beats real stupidity.
Atheism is a non-prophet organization.
Auntie Em, Hate you, hate Kansas, taking the dog. Dorothy.
Avenge yourself; live long enough to be a problem to your children. 
Be nice to your kids, for it is they who will choose your nursing home. 
Better to understand a little than to misunderstand a lot.
Bills travel through the mail at twice the speed of checks. 
Borrow money from pessimists-they don't expect it back. 
Change is inevitable, except from a vending machine.
Chaos, panic, and disorder - my work here is done.
Complex problems have simple, easy to understand wrong answers. 
Conscience is the inner voice that warns us somebody is looking.
Consciousness: That annoying time between naps.
Death is hereditary.
Democracy must be something more than two wolves and a sheep voting on what to have for dinner. – James Bovard
Despite the cost of living, have you noticed how popular it remains?
Diplomacy is the art of saying "nice doggy" until you can find a rock. 
Disappointment is anger for wimps.
Don't be irreplaceable; if you can't be replaced, you can't be promoted.
Don't be sexist; chicks hate that! 
Don't look back, they might be gaining on you.
Don't make me mad. I'm running out of places to hide the bodies.
Drawing on my fine command of language, I said nothing.
Eagles may soar, but weasels aren't sucked into jet engines. 
Employee of the month is a good example of how somebody can be both a winner and a loser at the same time.
Errors have been made. Others will be blamed.
Even the best of friends cannot attend each other's funeral.
Ever notice that "what the hell" is always the right decision?
Every day I get up and look through the Forbes list of the richest people in America. If I'm not on it, I go to work.
Everyone smiles in the same language.
Everything is funny, as long as it's happening to somebody else.
Experience is something you don't get until just after you need it.
First things first, but not necessarily in that order.
Five out of four people have a problem with fractions. 
For Sale: Parachute. Only used once, never opened, small stain.
Forgive your enemies, but never forget their names. 
Friends help you move. Real friends help you move bodies. 
Friends may come and go, but enemies accumulate. Thomas Jones 
Give me ambiguity or give me something else.
Giving money and power to government is like giving whiskey and car keys to teenage boys. – P.J. O'Rourke
Good judgment comes from bad experience and a lot of that comes from bad judgment.
Gravity: It's not just a good idea. It's the law.
Half the people in the world are above average.
Hard work has a future payoff. Laziness pays off now.
He who smiles in a crisis has found someone to blame.
Health nuts are going to feel stupid someday, lying in hospitals dying of nothing.
Hell hath no fury like the lawyer of a woman scorned. 
Help a man when he is in trouble, and he will remember you when he is in trouble again.
Hey, i was just talking about you. well, not about you specifically, about whores and hypocrisy.
How do you tell when you run out of invisible ink?
How does Teflon stick to the pan?
How many of you believe in telekinesis? Raise my hand.
I’m not a complete idiot, some parts are missing!
I’m writing a book. I’ve got the page numbers done.
I always wanted to be somebody, but now I realize I should have been more specific.
I am not infantile, you stinky poopyhead.
I asked God for a bike, but I know God doesn’t work that way. So I stole a bike and asked for forgiveness.
I can't remember if I'm the good twin or the evil one.
I couldn’t repair your brakes, so I made your horn louder.
I didn’t fight my way to the top of the food chain to be a vegetarian
I didn’t say it was your fault. I said I was going to blame you.
I do not know how the Third World War will be fought, but I know how the Fourth will: with sticks and stones.
I do not participate in any sport with ambulances at the bottom of a hill.
I don’t suffer from insanity. I enjoy every minute of it.
I don't have a solution but I admire the problem.
I don't have to outrun the bear. I only have to outrun you.
I don't mind the voices in my head, it's the ones in yours that bug me. 
I don't necessarily agree with everything I say.
I don't think I'm indecisive. . . 
I don't want to achieve immortality through my work; I want to achieve immortality through not dying. 
I feel like I’m diagonally parked in a parallel universe.
I get enough exercise just pushing my luck.
I hear voices in my head and they say they don't like you. 
I intend to live forever. So far, so good.
I just got lost in thought. It was unfamiliar territory.
I just thought of the best hyperbole
I love deadlines. I like the whooshing sound they make as they fly by.
I need someone really bad. Are you really bad?
I totally take back all those times I didn't want to nap when I was younger.
I used to be schizophrenic, but we're OK now.
I used to have an open mind but my brains kept falling out.
I used to listen to the voices in my head, but I ran out of places to hide the bodies.  
I used to think I was indecisive, but now I'm not so sure. 
I'd kill for a Nobel Peace Prize. 
I'm absolutely the single most modest person you will ever meet.
I'm having deja-vu and amnesia at the same time. It's like I think I've forgotten this before
I'm not crazy, I've just been in a very bad mood for 30 years.
I'm not tense, just terribly, terribly alert.
If someone says, "It's not the money, it's the principle of the thing," it's the money.
If after 2 hours in a poker game you are not sure who the pigeon is, you are.
If at first you don’t succeed, destroy all evidence that you tried.
If at first you don't succeed, skydiving is not for you.
If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it.
If I agreed with you we’d both be wrong.
If I had known I was going to live this long, I'd have taken better care of myself. 
If I walked on water people would say I couldn't swim.
If ignorance is bliss, why aren't there more happy people?
If it holds water, it's craft. If it leaks, it's art.
If it isn't broken, fix it until it is.
If things get any worse, I'll have to ask you to stop helping me.
If we aren't supposed to eat animals, why are they made of meat? 
If you can’t convince them, confuse them.
If you can read this, I can slam on my brakes and sue you!
If you have no specific destination in mind you can't be lost.
If you lend someone $20, and never see that person again, it was probably worth it.
If you must choose between two evils, pick the one you've never tried before.
If you tell the truth, you don't have to remember anything.
If you think nobody cares if you're alive, try missing a couple of car payments.
In nature, there are neither rewards nor punishments -- there are consequences.
Inside every older person is a younger person wondering, "What the heck happened?"
Instead of getting married again, I'm going to find a woman I don't like and just give her a house.
Is it time for your medication or mine?
Isn't it interesting that the same people who laugh at science fiction listen to weather forecasts and economists?
It ain't what they call you, it's what you answer to. 
It is bad luck to be superstitious.
It is easier to obtain forgiveness than permission!
It is not necessary to understand things in order to argue about them.
It is seldom that liberty of any kind is lost all at once.
It may be that my whole purpose in life is simply to serve as a warning to others. 
It's been lovely, but I have to scream now. 
It's better to have it and not need it than to need it and not have it. 
It's lonely at the top, but you eat better.
Just because you're paranoid doesn't mean they're not out to get you 
Just practising for my clown college audition.
Knowing too much about each other is exactly why people leave small towns and move to the city.
Knowledge is power, and power corrupts. So study hard and be evil.
Life can only be understood backwards; but it must be lived forwards.
Life is a terminal disease.
Life is what happens to you while you are making other plans.
Live each day as if it were the last day of your life, because so far, it is.
Living on Earth is expensive, But it does include a trip around the sun.
Lottery: A tax on people who are bad at math. 
Love may be blind, but marriage is a real eye opener.
Money isn't everything, but it sure keeps the kids in touch. 
Most problems are either unimportant or impossible to solve.
My kid had sex with your honor student. 
My wife keeps complaining I never listen to her (or something like that).
Never argue with a fool. Someone watching may not be able to tell the difference.
Never ask a barber if he thinks you need a haircut.
Never attribute to malice what can adequately be explained by stupidity. 
Never do your best card tricks for the group you play poker with. 
Never insult an alligator until after you have crossed the river.
Never put off till tomorrow what you can avoid all together.
Never test the depth of the water with both feet.
No good deed ever goes unpunished. 
No man would listen to you talk if he didn't know it was his turn next.
No one is listening until you make a mistake.
Nostalgia isn't what it use to be.
Not everything that can be counted counts, and not everything that counts can be counted
Nothing sucks more than that moment during an argument when you realize you're wrong.
Of all the things I've lost, it's my mind I miss the most. 
Oh Lord, give me patience, and GIVE IT TO ME NOW!
On your mark, get set, go away!
One of the symptoms of an approaching nervous breakdown is the belief that one's work is terribly important.
One out of every four Americans is suffering from some form of mental illness. Think of your three best friends. If they're okay, then it's you.
Plan to be spontaneous, tomorrow.
Please don't lie to me, unless you're absolutely sure I'll never find out the truth.
Politicians and diapers have one thing in common. They should both be changed regularly, and for the same reason.
Politics is the gentle art of getting votes from the poor and campaign funds from the rich by promising to protect each from the other.
Pride is what we have. Vanity is what others have.
Problems cannot be solved by the same level of thinking that created them. - Albert Einstein
Procrastinate now.
Puritanism: The haunting fear that someone, somewhere may be happy.
Quickly, I must hurry, for there go my people and I am their leader.
Quoting one is plagiarism. Quoting many is research.
Reality is a crutch for people who can't handle drugs.
Rehab is for quitters.
Remember, if the logs float upstream, they are not logs. 
Remember, it's the second mouse that gets the cheese.
Rock is dead. Long live paper and scissors.
Sex without love is an empty experience, but, as empty experiences go, it's one of the best. 
Some days it's just not worth gnawing through the leather straps.
Some days you are the bug, some days you are the windshield.
Some part of the journey is going to be uphill. 
Some people are only alive because it is illegal to shoot them.
Someday, we'll look back on this, laugh nervously and change the subject.
Sometimes I think war is God's way of teaching us geography.
Stress is when you wake up screaming and you realize you weren't asleep.
Success always occurs in private and failure in full view.
Support mental health or I'll kill you
Taxation WITH representation isn't so hot, either!
Teamwork is wasting half of one's time explaining to others why they are wrong.
The amount of work to be done increases in proportion to the amount of work already completed.
The beatings will continue until morale improves.
The Bible was written by the same people who said the Earth was flat. 
The creative are slaves to their talent, and must answer when it summons. 
The fact that no one understands you doesn't mean you're an artist.
The first ninety percent of the task takes ninety percent of the time, and the last ten percent takes the other ninety percent.
The future will be better tomorrow.
The goal of science is to build better mousetraps. The goal of nature is to build better mice.
The IQ of the group is the lowest IQ of a member of the group divided by the number of people in the group. 
The last thing I want to do is hurt you. But it's still on the list.
The last time politics and religion were mixed, people were burned at the stake.
The lion and the lamb shall lie down together, but the lamb won't get much sleep. 
The nice thing about standards is, there are so many to choose from.
The only change reading about something on the internet will make in someone's opinion is from none to wrong.
The only substitute for good manners is fast reflexes.
The race is not always to the swift, nor the battle to the strong -- but that's usually the way to bet.
The trouble with doing something right the first time is that nobody appreciates how difficult it was. 
The trouble with life is there's no background music. 
The trouble with the gene pool is that there's no lifeguard.
There are 10 types of people in the world. Those who understand binary, and those who don't.
There are no rules here -- we're trying to accomplish something.
There has been an alarming increase in the number of things I know nothing about. 
There's an old proverb that says just about whatever you want it to.
There's never time to do it right, but always time to do it over!
There's no place like 127.0.0.1
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.
Three out of four voices in my head said I should stay home and clean the guns. 
Time is nature's way of keeping everything from happening all at once.
Timing has an awful lot to do with the outcome of a rain dance.
To err is human, to blame it on somebody else shows management potential.
Today is the first day of the rest of your life. But so was yesterday, and look how you messed that up.
Too many freaks, not enough circuses.
Trust everybody, but cut the cards.
War does not determine who is right – only who is left.
Warning: Dates on calendar are closer than they appear.
We never really grow up, we only learn how to act in public.
We should forgive our enemies, but only after they've been taken out and shot.
We were born naked, wet and hungry. Then things got worse.
We will burn that bridge when we come to it.
Well, this day was a total waste of makeup.
What happens if you get scared half to death twice?
What if the hokey pokey really is what it's all about?
What's another word for Thesaurus?
Whatever kind of look you were going for, you missed.
When all is said and done, more is said than done.
When the government's boot is on your throat, whether it is a left boot or a right boot is of no consequence. – Gary Lloyd
When you are in deep water it's a good idea to keep your mouth shut.
When you gamble, you have to consider losing as one of the possibilities.
When you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Why is "abbreviation" such a long word?
Women need a reason to have sex. Men just need a place
Wrinkled was not one of the things I wanted to be when I grew up!
You can get more with a kind word and a gun than you can with a kind word alone. 
You sound reasonable......time to up my medication.
You're just jealous because the voices only talk to ME.
Your theory is crazy, but it's not crazy enough to be true.
Your village called. They're missing their idiot.
Every organization is perfectly designed to get the results they are getting.
GIF.gif
If you can wrap your head around how we are using ActionTimer to incrementally change the variable controlling the alpha value, how the various bits of that interact dynamically, then it's pretty trivial to use the approach anywhere you want.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Fade in/out effect on value change?

Post by xenium »

Very nice visual effect for the clock.
I noticed it exists in the code [MeterCounter] but do not see [MeasureCounter] ?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fade in/out effect on value change?

Post by jsmorley »

xenium wrote:Very nice visual effect for the clock.
I noticed it exists in the code [MeterCounter] but do not see [MeasureCounter] ?
Sorry, that [MeterCounter] shouldn't be there. That was part of a different skin that I was testing. It doesn't do anything in this skin.
User avatar
srkian19
Posts: 3
Joined: August 11th, 2018, 12:31 pm
Location: India
Contact:

Re: Fade in/out effect on value change?

Post by srkian19 »

Thank you! it's possible to add effect line by line of Quote of the day(more than 1 line quote)?, Like fade lines with time interval(s).
Post Reply