mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
HTML5: Add support for Input.vibrate_handheld()
This commit is contained in:
parent
47edfa8769
commit
130e715ab9
6 changed files with 20 additions and 2 deletions
|
|
@ -534,6 +534,15 @@ const GodotInput = {
|
|||
GodotRuntime.free(ptr);
|
||||
}, false);
|
||||
},
|
||||
|
||||
godot_js_input_vibrate_handheld__sig: 'vi',
|
||||
godot_js_input_vibrate_handheld: function (p_duration_ms) {
|
||||
if (typeof navigator.vibrate !== 'function') {
|
||||
GodotRuntime.print('This browser does not support vibration.');
|
||||
} else {
|
||||
navigator.vibrate(p_duration_ms);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
autoAddDeps(GodotInput, '$GodotInput');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue