Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel: createParallelEffectWithEasing() #1824

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions source/feathers/motion/Parallel.as
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,24 @@ package feathers.motion
return new ParallelEffectContext(target, rest);
};
}

/**
* Creates an effect function that combines multiple effect functions
* that will play at the same time, in parallel. The ease function
* will apply to the full duration of the effect, which will be the
* longest duration of the parallel effects.
*
* @productversion Feathers 3.5.0
*/
public static function createParallelEffectWithEasing(ease:Object, effect1:Function, effect2:Function, ...rest:Array):Function
{
//the order doesn't matter, so just add them at the end
rest[rest.length] = effect1;
rest[rest.length] = effect2;
return function(target:DisplayObject):IEffectContext
{
return new ParallelEffectContext(target, rest, ease);
};
}
}
}
4 changes: 2 additions & 2 deletions source/feathers/motion/effectClasses/ParallelEffectContext.as
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package feathers.motion.effectClasses
/**
* Constructor.
*/
public function ParallelEffectContext(target:DisplayObject, functions:Array)
public function ParallelEffectContext(target:DisplayObject, functions:Array, transition:Object = null)
{
var duration:Number = 0;
var count:int = functions.length;
Expand All @@ -36,7 +36,7 @@ package feathers.motion.effectClasses
duration = contextDuration;
}
}
super(target, duration);
super(target, duration, transition);
}

/**
Expand Down