phetsims / scenery

Scenery is an HTML5 scene graph.
MIT License
53 stars 12 forks source link

Accepting Properties as values for most options #632

Open jonathanolson opened 7 years ago

jonathanolson commented 7 years ago

In https://github.com/phetsims/scenery-phet/issues/287, it was noted that being able to pass in Property types to options (Node options or otherwise) can sometimes be more convenient.

I've had cases where this would be useful for visibility, and @jbphet noted a case where it would be useful for Path's Shape.

Due to the potential costs of implementation (and documentation), I've tagged it as low priority. If anyone feels like this would be worth the time, it could be brought up at developer meeting. (I won't implement any of this without wide group consensus).

pixelzoom commented 7 years ago

The other important thing from phetsims/scenery-phet#287 that's not noted above is that polymorphic options are acceptable. E.g.:

color: new Color( 0, 0, 255 ), // {Color|string|Property.<Color|string>}