Difference between revisions of "Global Command: createHapticEffectCondition"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Create a constant haptic effect for devices supporting haptic effects. {| class="ts" |- | style="width:15%" | Related functions | Global Command: createHapticEffectConstant...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Create a | + | Create a haptic effect for devices which support haptic effects. |
{| class="ts" | {| class="ts" | ||
Line 10: | Line 10: | ||
== Syntax == | == Syntax == | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
− | + | createHapticEffectCondition(effectType, length, delay, right_sat, left_sat, right_coeff, left_coeff, deadband, center) | |
</syntaxhighlight> | </syntaxhighlight> | ||
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 33: | Line 33: | ||
| | | | ||
|- | |- | ||
− | | | + | | right_sat |
| int | | int | ||
| | | | ||
|- | |- | ||
− | | | + | | left_sat |
| int | | int | ||
| | | | ||
|- | |- | ||
− | | | + | | right_coeff |
| int | | int | ||
| | | | ||
|- | |- | ||
− | | | + | | left_coeff |
| int | | int | ||
| | | | ||
|- | |- | ||
− | | | + | | deadband |
| int | | int | ||
| | | | ||
|- | |- | ||
− | | | + | | center |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| int | | int | ||
| | | | ||
Line 78: | Line 66: | ||
|- | |- | ||
| integer | | integer | ||
− | | The id of the created effect. | + | | The unique id of the created effect. |
|} | |} | ||
Line 84: | Line 72: | ||
== Examples == | == Examples == | ||
− | '''Example 1:''' Create a | + | '''Example 1:''' Create and start a haptic effect. |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
− | local effectID = | + | local effectID = createHapticEffectCondition('spring', 5000, -1, 0xFFFF, 0xFFFF, 0x2000, 0x2000, -1, 0x1000) |
startHapticEffect(effectID) | startHapticEffect(effectID) | ||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{toc}} | {{toc}} |
Latest revision as of 11:12, 5 August 2023
Create a haptic effect for devices which support haptic effects.
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)