Difference between revisions of "Global Command: createHapticEffectConstant"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Create a constant haptic effect for devices which support haptic effects. {| class="ts" |- | style="width:15%" | Related functions | Global Command: createHapticEffectCondi...")
 
 
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 78: Line 78:
 
|-
 
|-
 
| integer
 
| integer
| The id of the created effect.
+
| The unique id of the created effect.
 
|}
 
|}
  

Latest revision as of 11:13, 5 August 2023

Create a constant haptic effect for devices which support haptic effects.

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


Syntax

createHapticEffectConstant(effectType, length, delay, level, attack_length, attack_level, fade_length, fade_level, effectDirection [, dir0, dir1, dir2])


Parameters

Parameter Type Description
effectType string Type of the effect
length int Duration of the effect in milliseconds
delay int
level int
attack_length int
attack_level int
fade_length int
fade_level int
effectDirection string
dir0 int
dir1 int
dir2 int


Return values

Type Description
integer The unique id of the created effect.


Examples

Example 1: Create a constant haptic effect and start it.

local effectID = createHapticEffectConstant('constant', 1000, -1, 0x6000, 1000, -1, 1000, -1, 'polar', 20000)
startHapticEffect(effectID)