playground icon indicating copy to clipboard operation
playground copied to clipboard

Buttons in mouse and touch

Open TNick opened this issue 9 years ago • 4 comments

this.buttons = {};

seems to be unused in Mouse.js and Touch.js.

In Mouse.js lines like this

this[buttonName] = true;

should be changed to

this.buttons[buttonName] = true;

?

I don't see any use case in Touch.js.

TNick avatar Sep 05 '15 13:09 TNick

I probably wanted app.mouse.buttons.left, but made a typo and got used to app.mouse.left without noticing it.

I am removing this.buttons with the next release then.

I guess Pointer.js is missing button state property now.

rezoner avatar Sep 05 '15 13:09 rezoner

Also, gamepads is unused in here

this.gamepads = {};

because of this line.

var gamepads = navigator.getGamepads();

Or, maybe, the idea was to use this.gamepads[i] instead of this[i] ?

I don't have gamepads to test but how would you get the number of gamepads? I'm missing something obvious, probably.

And, since I'm at it: what's the purpose of zeroState? Doesn't seem to be used anywhere.

TNick avatar Sep 05 '15 14:09 TNick

(i'm just gonna add things here if you don't mind)

Here prevEasing and prevDuration seem to have no function.


Here repeat is defined but there is no implementation for repeating the animation as far as I can see.


VideoRecorder depends on canvas render. Shouldn't this be under layer/? I doin't see it in documentation. Is it experimental or deprecated?


Last example on http://playgroundjs.com/playground-tween is not working in Chrome and Firefox (black background).

TNick avatar Sep 05 '15 20:09 TNick

Gamepads:

The reason for this[i] over this.gamepads[i] is because it would end up with app.gamepads.gamepads which is counter intuitive

I've been using zeroState at some point as my local copy of a gamepad button stat. I had to copy the buttons as they are read-only and I can't. This whole thing has to be rewriten so I wouldn't be too attached to anything gamepad related.

Video Recorder:

Will probably get removed, it's slow, clumsy, and depends on Whammy.js

Tweens:

I will fix it ;)

rezoner avatar Sep 06 '15 07:09 rezoner