phetsims / vegas

Reusable game components for PhET simulations.
MIT License
1 stars 4 forks source link

LevelStartButton: misc work #3

Closed pixelzoom closed 10 years ago

pixelzoom commented 10 years ago

The current implementation isn't leveraging anything from 'sun', and it's not even using scenery.ButtonListener.

pixelzoom commented 10 years ago

I also noticed that this button doesn't pop back up when you roll off of it. And if you roll off of it and release pointer, the button stays depressed.

pixelzoom commented 10 years ago

I replaced the generic input listener with a scenery.ButtonListener, and borrowed behavior from sun.PushButton. Can't implement as a subtype of sun.RectanglePushButton because it doesn't support the pseudo-3D look of this button (drop shadow, depress when press, pop up when released,...)

pixelzoom commented 10 years ago

Another issue... This instantiation of ProgressIndicator appears to be specific to BAA. The star diameter is being set to buttonWidth/6, which probably works for BAA (which has 5 stars) but won't work in the general case.

new ProgressIndicator( numStars, options.buttonWidth / 6, scoreProperty, maxPossibleScore )

Perhaps '6' should be replaced with numStars-1 ?

pixelzoom commented 10 years ago

Ah... It's not as easy as using numStars-1. We need to know the x-spacing used between stars by ProgressIndicator, and we need to know the x-margin desired for the start on the 'button'. So there are some problems to sort out here.

pixelzoom commented 10 years ago

Looks like JB fixed the issue with number of stars in https://github.com/phetsims/vegas/commit/e3b2ed4272eb9278ce884a08ae32cce6e93ec32b.

pixelzoom commented 10 years ago

While these is still work to be done on LevelStartButton (see #7, #13, #14), everything mentioned in this issue appears to be done. So closing.