TrailVisibilityTracker¶
Overview¶
Broadcasts when any Node or its ancestors in a Trail change visibility, effectively observing changes to Trail.isVisible().
@author Jesse Greenberg
Class TrailVisibilityTracker¶
Constructor¶
new TrailVisibilityTracker( trail, options )¶
Instance Methods¶
addListener( listener )¶
Adds a listener function that will be synchronously called whenever the visibility this Trail changes. @public
@param {Function} listener - Listener will be called with no arguments.
removeListener( listener )¶
Removes a listener that was previously added with addListener(). @public
@param {Function} listener
dispose()¶
onVisibilityChange()¶
When visibility of the Trail is changed, notify listeners. @private
notifyListeners()¶
Notify listeners to a change in visibility. @private
Source Code¶
See the source for TrailVisibilityTracker.js in the scenery repository.