Skip to content
Merged
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
29 changes: 29 additions & 0 deletions flixel/input/gamepad/FlxGamepad.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package flixel.input.gamepad;

import flixel.util.FlxColor;
import flixel.input.FlxInput.FlxInputState;
import flixel.input.gamepad.FlxGamepadMappedInput;
import flixel.input.gamepad.lists.FlxGamepadAnalogList;
Expand Down Expand Up @@ -900,6 +901,34 @@ class FlxGamepad implements IFlxDestroyable
return mapping.getMappedInput(id);
}

/**
* Start a rumble effect.
*
* @param lowFrequency The intensity of the low frequency (left) rumble motor
* @param highFrequency The intensity of the high frequency (right) rumble motor
* @param duration The length of the rumble effect in milliseconds
*/
public function rumble(lowFrequency:Float, highFrequency:Float, duration:Int):Void
{
#if FLX_GAMEINPUT_API
if (_device != null)
_device.rumble(lowFrequency, highFrequency, duration);
#end
}

/**
* Update the LED color.
*
* @param color The intensity of the color.
*/
public function setLED(color:FlxColor):Void
{
#if FLX_GAMEINPUT_API
if (_device != null)
_device.setLED(color.red, color.green, color.blue);
#end
}

public function toString():String
{
return FlxStringUtil.getDebugString([
Expand Down
Loading