Utility class for extra vibration functions.
Static variables
staticamplitudeTween:FlxTween
Tween that is used in increasingVibrate function for tweening vibration amplitude.
Static methods
staticincreasingVibrate(startAmplitude:Float, targetAmplitude:Float, tweenDuration:Float = 1):Void
Triggers a queue of small vibrations with increasing amplitude. When the amplitudeTween is finished, triggers a single strong vibration.
Parameters:
startAmplitude | Start amplitude value. |
|---|---|
targetAmplitude | Target amplitude value. |
tweenDuration | Duration of the tween. |
staticvibrate(period:Float = Constants.DEFAULT_VIBRATION_PERIOD, duration:Float = Constants.DEFAULT_VIBRATION_DURATION, amplitude:Float = Constants.DEFAULT_VIBRATION_AMPLITUDE, sharpness:Float = Constants.DEFAULT_VIBRATION_SHARPNESS, ?targetHapticsModes:Array<HapticsMode>):Void
Triggers vibration.
Parameters:
period | The time for one complete vibration in seconds. |
|---|---|
duration | The time taken for a complete cycle in seconds. |
amplitude | The intensity of the vibration (0.0 to 1.0). |
sharpness | Controls the feel of vibration. |
staticvibrateByPreset(?vibrationPreset:Null<VibrationPreset>):Void
Triggers vibration using a preset.
Parameters:
vibrationPreset | Vibration's data. |
|---|