Re: [w3c/gamepad] Added a supplemental "Extensions" spec (#32)

I would like your opinion on this syntax:

gamepad.HapticEffect([0, 1], [1.0, 0.5, 0, 1.0], [1.0, 0.5, 1.0, 1.0], [300.0, 500.0, 1000.0, 200.0]);
# First array is list of haptics
# Second array is list of "values" for haptic[0]
# Third array is list of "values" for haptic[1]
# Fourth array is duration between samples, shared between all haptic motors in the effect

gamepad.HapticEffectCompleted(function() { ..... });
# When the haptic effect has completed, the callback function is triggered

gamepad.HapticEffect([0, 1], [0.0, 0.0], [0.0]);
# Triggering a new haptic effect cancels the last if still playing.
# This haptic effect effectively sets haptic[0] and haptic[1] values to 0, stopping any effects.

Alternately, would a dictionary with named members be better for the parameters?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/32#issuecomment-247169142

Received on Wednesday, 14 September 2016 21:59:36 UTC