Difference between revisions of "Global Command: createHapticEffectCondition"

From The Official Visionaire Studio: Adventure Game Engine Wiki
 
Line 23: Line 23:
 
| effectType
 
| effectType
 
| string
 
| string
|  
+
| Type of the effect.
 
|-
 
|-
 
| length
 
| length
 
| int
 
| int
|  
+
| Duration of the effect in milliseconds.
 
|-
 
|-
 
| delay
 
| delay
Line 66: Line 66:
 
|-
 
|-
 
| integer
 
| integer
| The id of the created effect.
+
| The unique id of the created effect.
 
|}
 
|}
  

Latest revision as of 12:12, 5 August 2023

Create a haptic effect for devices which support haptic effects.

Related functions createHapticEffectConstant | createHapticEffectLeftRight | createHapticEffectPeriodic | createHapticEffectRamp | startHapticEffect | startHapticRumble | stopHapticEffect | stopHapticRumble


Syntax

createHapticEffectCondition(effectType, length, delay, right_sat, left_sat, right_coeff, left_coeff, deadband, center)


Parameters

Parameter Type Description
effectType string Type of the effect.
length int Duration of the effect in milliseconds.
delay int
right_sat int
left_sat int
right_coeff int
left_coeff int
deadband int
center int


Return values

Type Description
integer The unique id of the created effect.


Examples

Example 1: Create and start a haptic effect.

local effectID = createHapticEffectCondition('spring', 5000, -1, 0xFFFF, 0xFFFF, 0x2000, 0x2000, -1, 0x1000)
startHapticEffect(effectID)