Open jonathanolson opened 11 years ago
Ideally, this should be done almost exactly like Scene's focusRingSVGContainer / focusRingPath. It is drawn in SVG directly, has pointer-events none (so it is pass-through on all browsers for DOM elements below), and is updated on updateScene().
It could be a dot, crosshair, ring, circle, etc. Not sure what will work best.
Code to do this should only be active once scene.input is created (it's a scenery.Input, and is created in Scene.initialize*Events). Hook into Input.addPointer / Input.removePointer for touches (and pen events also). If you want the mouse to be recorded, do this on the pointer instance that is created in the Input constructor.
To record pointer movements, add a 'move' input listener onto pointers when they are added (addPointer), and remove the listener when they disappear (removePointer).
I was imagining experimenting with ghosting (fade out previous locations instead of only showing a graphic at the current location), or possibly trails, so that it is easy to visualize the path.
Additionally, I thought it would be useful to show something for state changes (either a change of color when the pointer is up/down, which is important for the mouse, or some other visual way of indicating something).
Also, this should be toggle-able during runtime.
We should also most likely place https://github.com/phetsims/scenery/issues/79 in the same area.
Merged changes to master, closing.
Outstanding TODOs from this week's meeting:
Does scenery 02 have any effort done on the task of showing pointers?
I believe I ported the overlay. Besides that no extra effort.
I marked this for scenery 02, not needed in scenery/01.
@ariel-phet and @samreid, this is marked as high-priority and remaining-work-for-0.2. Is there a deadline on this particular feature?
As far as I know, there is no deadline and we could safely drop the high-priority
label.
This feature was requested by ETS for playback of pointers for research. Would be great for me to get @jonathanolson help on the best way to store the pointer locations as a function of time.
@kathy-phet reminded me that we wish to have pointers displayed during input event playback, and I wanted to check in on the status of this issue. @jonathanolson what is the status? What is your current recommendation for how to proceed?
@jonathanolson what is the status? What is your current recommendation for how to proceed?
Your original implementation seems to be working, just add ?showPointers.
It's different if you want to store pointer locations as a function of time, in addition to the Scenery events. You only need the Scenery events in order to show pointer locations.
Wow, neat! Looks great. Looks like this is just open to address the issues in this comment? https://github.com/phetsims/scenery/issues/111#issuecomment-25262533
Unassigning for now.
Useful for recordings. We could provide a default graphic behavior, but allow plugging in other ways of displaying them?