Skip to content

Commit

Permalink
Improving the maxWidth handling for AllLevelsCompletedNode, see phets…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Dec 18, 2018
1 parent 60ab08e commit c534e1d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions js/AllLevelsCompletedNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,28 @@ define( function( require ) {
function AllLevelsCompletedNode( listener, options ) {
Node.call( this );

options = _.extend( {
// {number} - Controls the width of the main message and the text in the button
maxTextWidth: 300
}, options );

// create the smiley face
var faceNode = new FaceNode( FACE_DIAMETER );

// create the dialog text
var textMessage = new RichText( youCompletedAllLevelsString, {
font: new PhetFont( 25 ),
lineWrap: 300,
maxWidth: 300,
maxWidth: options.maxTextWidth,
maxHeight: 300
} );

// create the button
var button = new RectangularPushButton( {
content: new Text( doneString, { font: new PhetFont( 30 ) } ),
content: new Text( doneString, {
font: new PhetFont( 30 ),
maxWidth: options.maxTextWidth
} ),
listener: listener,
baseColor: 'yellow'
} );
Expand Down

0 comments on commit c534e1d

Please sign in to comment.