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...") |
|||
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 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 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}} |
Revision as of 15:10, 19 May 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 | |
length | int | |
delay | int | |
right_sat | int | |
left_sat | int | |
right_coeff | int | |
left_coeff | int | |
deadband | int | |
center | int |
Return values
Type | Description |
---|---|
integer | The 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)