I need a math equation that will give me an opacity given that a transition is already in progress. Usually I use the following method for transitions.
@opacity_target = arg1
@opacity_duration = arg2
Then apply the following code each frame during the transition:
@opacity = (@opacity * (@opacity_duration - 1) + @opacity) / @opacity_duration
That works fine as long as I start the transition while on that map. But I need to start that kind of a transition while not on that map, then determine the value of the opacity mid way through the transition. I do not remember all the algebra formulas from high school any more. I can also store more variables if needed. What is the formula to do that?
(Mods: please move where most appropriate if needed)
@opacity_target = arg1
@opacity_duration = arg2
Then apply the following code each frame during the transition:
@opacity = (@opacity * (@opacity_duration - 1) + @opacity) / @opacity_duration
That works fine as long as I start the transition while on that map. But I need to start that kind of a transition while not on that map, then determine the value of the opacity mid way through the transition. I do not remember all the algebra formulas from high school any more. I can also store more variables if needed. What is the formula to do that?
(Mods: please move where most appropriate if needed)