This is a modified version of FlxWaveSprite by Tim Hely

Constructor

@:value({ InterlaceOffset : 0, Wavelength : 5, Speed : 3, Center : 0.5, Strength : 10 })new(?Mode:FlxWaveMode, Strength:Int = 10, Center:Float = 0.5, Speed:Float = 3, Wavelength:Int = 5, ?Direction:FlxWaveDirection, InterlaceOffset:Float = 0)

Creates a new FlxEffectWave, which applies a wave-distortion effect.

Parameters:

Mode

Which Mode you would like to use for the effect. ALL = applies a constant distortion throughout the image, END = makes the effect get stronger towards the bottom of the image, and START = the reverse of END.

Strength

How strong you want the effect.

Center

The 'center' of the effect when using END or START modes. Anything before(END)/after(START) this point on the image will have no distortion effect. Ratio based on the bitmapData size.

Speed

How fast you want the effect to move. Higher values = faster.

Wavelength

How long waves are.

Direction

Which Direction you want the effect to be applied (HORIZONTAL or VERTICAL).

InterlaceOffset

The wave ratio to offset every odd line of the bitmapData. Must be a value between 0 and 1;

Variables

@:value(true)active:Bool = true

center:Float

The 'center' of our sprite (where the wave effect should start/end). Ratio based on the bitmapData size.

direction:FlxWaveDirection

Which direction the wave effect should be applied.

interlaceOffset:Float

The wave ratio to offset every odd line of the BitmapData. Must be a value between 0 and 1.

Available since

2.1.0

.

mode:FlxWaveMode

Which mode we're using for the effect.

@:value(FlxPoint.get())read onlyoffset:FlxPoint = FlxPoint.get()

speed:Float

How fast should the wave effect be (higher = faster).

strength:Int

How strong the wave effect should be.

wavelength:Int

How long waves are.

Methods