Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to independently disable cannon height and angle adjustments #248

Closed
arouinfar opened this issue Feb 23, 2021 · 5 comments
Closed

Comments

@arouinfar
Copy link
Contributor

For #244

Related issues
phetsims/scenery#1041
phetsims/scenery#1116
phetsims/bending-light#397

The cannon can be adjusted in two ways:

  • dragging the barrel to change the angle
  • dragging the cannon base/pedestal to change the height

Clients should be able to independently disable these interactions (whether by pickableProperty or its successor).

@zepumph
Copy link
Member

zepumph commented Jul 26, 2021

I actually though it was easier to instrument on the listeners themselves, since for the height one the listener was added to many Nodes. Having the flexibility to disable based on the Node and/or listener is really nice.

Please experiment with PhET-iO elements like these, and let me know what you think:

height: projectileMotion.introScreen.view.cannonNode.heightDragListener.enabledProperty

rotation: projectileMotion.introScreen.view.cannonNode.barrelTopDragListener.enabledProperty

@zepumph
Copy link
Member

zepumph commented Jul 26, 2021

I also fixed the cursor, so that it can come from the input listener instead of each Node that the single listener is added to. This further simplifies the file. Now, disabled input listeners will show the default cursor.

@arouinfar
Copy link
Contributor Author

The behavior is looking really nice. One (hopefully) minor request -- when cannonNode.heightDragListener.enabledProperty is false can the cueing arrows be hidden?
image

@zepumph
Copy link
Member

zepumph commented Jul 29, 2021

It has been done.

@arouinfar
Copy link
Contributor Author

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants