Skip to content

Commit

Permalink
Read-only on play area items, see #147
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Jun 9, 2020
1 parent 2b2cfbf commit a921493
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
5 changes: 2 additions & 3 deletions js/wave-on-a-string/view/StringNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ class StringNode extends Node {
/**
* @param {WOASModel} model
* @param {Emitter} frameEmitter - Emits an event when the animation frame changes
* @param {Tandem} tandem
* @param {Object} [options]
*/
constructor( model, frameEmitter, tandem, options ) {
super( { layerSplit: true, tandem: tandem } );
constructor( model, frameEmitter, options ) {
super( { layerSplit: true } );

let stringShape = new Shape();
const stringPath = new Path( stringShape, {
Expand Down
42 changes: 38 additions & 4 deletions js/wave-on-a-string/view/WOASScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,57 @@ class WOASScreenView extends ScreenView {
const endNode = new EndNode( model, this.frameEmitter, {
x: Constants.endStringNode,
y: Constants.yStringNode,
tandem: wavePlayAreaTandem.createTandem( 'endNode' )
tandem: wavePlayAreaTandem.createTandem( 'endNode' ),
phetioComponentOptions: {
opacityProperty: {
phetioReadOnly: true
},
pickableProperty: {
phetioReadOnly: true
},
visibleProperty: {
phetioReadOnly: true
}
}
} );
endNode.windowNode.x += Constants.endStringNode;
endNode.windowNode.y += Constants.yStringNode;
this.addChild( endNode.windowNode );
this.addChild( new ReferenceLine( model, tandem.createTandem( 'referenceLineNode' ) ) );
this.addChild( endNode );
this.addChild( new StringNode( model, this.frameEmitter, wavePlayAreaTandem.createTandem( 'stringNode' ), {
this.addChild( new StringNode( model, this.frameEmitter, {
x: Constants.startStringNode,
y: Constants.yStringNode,
radius: Constants.segmentStringNodeRadius
radius: Constants.segmentStringNodeRadius,
tandem: wavePlayAreaTandem.createTandem( 'stringNode' ),
phetioComponentOptions: {
opacityProperty: {
phetioReadOnly: true
},
pickableProperty: {
phetioReadOnly: true
},
visibleProperty: {
phetioReadOnly: true
}
}
} ) );
this.addChild( new StartNode( model, this.frameEmitter, {
x: Constants.startStringNode,
y: Constants.yStringNode,
range: Constants.yWrenchRange,
tandem: wavePlayAreaTandem.createTandem( 'startNode' )
tandem: wavePlayAreaTandem.createTandem( 'startNode' ),
phetioComponentOptions: {
opacityProperty: {
phetioReadOnly: true
},
pickableProperty: {
phetioReadOnly: true
},
visibleProperty: {
phetioReadOnly: true
}
}
} ) );
this.addChild( windowImage = new Node( {
children: [ new Image( windowEdgeImage, {
Expand Down

0 comments on commit a921493

Please sign in to comment.