| Package | org.as3lib.kitchensync.easing |
| Class | public class Oscillate |
Oscillate is slightly different from the other easing classes. The functions in this class cause
motion that oscillates at a specified frequency based on the timeElapsed. The values will continue to oscilate
between 0.0 and 1.0 without reaching an end point. However, if snapping is set to true, the
functions will return a 1.0 when the duration has elapsed.
The easing classes provide static methods for interpolating the change between two values over time.
Each class handles the interpolation, or easing, differently. Each class typically contains three methods
- easeIn(), easeOut() and easeInOut() - which vary the rate of change
of the values. Most of the easing functions produce values as a percentage - a number between 0.0 and 1.0
See also
| Property | Defined by | ||
|---|---|---|---|
| defaultFrequency : Number = 1 [static]
| Oscillate | ||
| defaultPulseWidth : Number = 0.5 [static]
| Oscillate | ||
| snapping : Boolean = false [static]
| Oscillate | ||
| Method | Defined by | ||
|---|---|---|---|
|
absoluteSine(timeElapsed:Number, duration:Number, frequency:Number):Number
[static]
Oscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts
in an absolute sinusoidal (half-wave) motion.
| Oscillate | ||
|
pulse(timeElapsed:Number, duration:Number, frequency:Number, pulseWidth:Number):Number
[static]
Oscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts
in square or pulse wave motion.
| Oscillate | ||
|
sawtooth(timeElapsed:Number, duration:Number, frequency:Number):Number
[static]
Oscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts
in linear motion.
| Oscillate | ||
|
sine(timeElapsed:Number, duration:Number, frequency:Number):Number
[static]
Oscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts
in a sinusoidal motion.
| Oscillate | ||
|
triangle(timeElapsed:Number, duration:Number, frequency:Number):Number
[static]
Oscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts
in linear motion.
| Oscillate | ||
| defaultFrequency | property |
public static var defaultFrequency:Number = 1
| defaultPulseWidth | property |
public static var defaultPulseWidth:Number = 0.5
| snapping | property |
public static var snapping:Boolean = false
| absoluteSine | () | method |
public static function absoluteSine(timeElapsed:Number, duration:Number, frequency:Number):NumberOscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts in an absolute sinusoidal (half-wave) motion. The subject will appear to be bouncing. The position will be based on the timeElapsed and frequency.
ParameterstimeElapsed:Number — - Specifies the time since the tween began in milliseconds or frames.
|
|
duration:Number — - Specifies the duration of the tween, in milliseconds or frames.
|
|
frequency:Number — - The frequency of the sine wave in hertz. Higher is faster. 1/frequency = wavelength
|
Number — Number - between 0.0 and 1.0 based on the time and frequency. Returns 1.0 if duration is elapsed and snapping is turned on.
|
| pulse | () | method |
public static function pulse(timeElapsed:Number, duration:Number, frequency:Number, pulseWidth:Number):NumberOscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts in square or pulse wave motion. The subject will appear to alternate between the start and end points. The position will be based on the timeElapsed and frequency.
ParameterstimeElapsed:Number — - Specifies the time since the tween began in milliseconds or frames.
|
|
duration:Number — - Specifies the duration of the tween, in milliseconds or frames.
|
|
frequency:Number — - The frequency of the sine wave in hertz. Higher is faster. 1/frequency = wavelength
|
|
pulseWidth:Number — - The width of the upside of the square wave as a percentage. 0.5 is half up, half down. 0.0 is all down, 1.0 is all up.
|
Number — Number - between 0.0 and 1.0 based on the time and frequency. Returns 1.0 if duration is elapsed and snapping is turned on.
|
| sawtooth | () | method |
public static function sawtooth(timeElapsed:Number, duration:Number, frequency:Number):NumberOscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts in linear motion. The position will be based on the timeElapsed and frequency.
ParameterstimeElapsed:Number — - Specifies the time since the tween began in milliseconds or frames.
|
|
duration:Number — - Specifies the duration of the tween, in milliseconds or frames.
|
|
frequency:Number — - The frequency of the sine wave in hertz. Higher is faster. 1/frequency = wavelength
|
Number — Number - between 0.0 and 1.0 based on the time and frequency. Returns 1.0 if duration is elapsed and snapping is turned on.
|
| sine | () | method |
public static function sine(timeElapsed:Number, duration:Number, frequency:Number):NumberOscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts in a sinusoidal motion. The position will be based on the timeElapsed and frequency.
ParameterstimeElapsed:Number — - Specifies the time since the tween began in milliseconds or frames.
|
|
duration:Number — - Specifies the duration of the tween, in milliseconds or frames.
|
|
frequency:Number — - The frequency of the sine wave in hertz. Higher is faster. 1/frequency = wavelength
|
Number — Number - between 0.0 and 1.0 based on the time and frequency. Returns 1.0 if duration is elapsed and snapping is turned on.
|
| triangle | () | method |
public static function triangle(timeElapsed:Number, duration:Number, frequency:Number):NumberOscillates between 0 and 1.0 (starting with 0 and ending with 1.0) for as long as the duration lasts in linear motion. The position will be based on the timeElapsed and frequency.
ParameterstimeElapsed:Number — - Specifies the time since the tween began in milliseconds or frames.
|
|
duration:Number — - Specifies the duration of the tween, in milliseconds or frames.
|
|
frequency:Number — - The frequency of the sine wave in hertz. Higher is faster. 1/frequency = wavelength
|
Number — Number - between 0.0 and 1.0 based on the time and frequency. Returns 1.0 if duration is elapsed and snapping is turned on.
|