Difference between revisions of "Global Command: createHapticEffectRamp"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Create a haptic ramp effect for devices which support haptic effects. {| class="ts" |- | style="width:15%" | Related functions | Global Command: createHapticEffectCondition...") |
|||
| Line 88: | Line 88: | ||
== Examples == | == Examples == | ||
| − | '''Example 1:''' Create a | + | '''Example 1:''' Create a haptic ramp effect and start it. |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local effectID = createHapticEffectRamp('ramp', 5000, -1, 0x4000, -0x4000, 1000, -1, 1000, -1, 'cartesian', 1, -1) | local effectID = createHapticEffectRamp('ramp', 5000, -1, 0x4000, -0x4000, 1000, -1, 1000, -1, 'cartesian', 1, -1) | ||
Latest revision as of 11:32, 5 August 2023
Create a haptic ramp effect for devices which support haptic effects.
Syntax
createHapticEffectRamp(effectType, length, delay, start, end, 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 | |
| start | int | |
| end | 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 effect. |
Examples
Example 1: Create a haptic ramp effect and start it.
local effectID = createHapticEffectRamp('ramp', 5000, -1, 0x4000, -0x4000, 1000, -1, 1000, -1, 'cartesian', 1, -1)
startHapticEffect(effectID)