Skip to content

Commit

Permalink
factor out const image
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 5, 2024
1 parent 9522aaf commit 113f626
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/linegame/view/LineGameLevelSelectionButtonGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,21 @@ function createLevelSelectionButtonIcon( level: number, levelImage: HTMLImageEle
// Level N
const stringProperty = new DerivedStringProperty( [ GraphingLinesStrings.pattern_Level_0StringProperty ],
pattern => StringUtils.format( pattern, level + 1 ) );

const text = new Text( stringProperty, {
font: new PhetFont( 40 ),
maxWidth: 100
} );

const image = new AlignBox( new Image( levelImage, { scale: 0.54 } ), {
const image = new Image( levelImage, { scale: 0.54 } );

const alignBox = new AlignBox( image, {
group: iconAlignGroup
} );

// 'Level N' centered above image
return new VBox( {
spacing: 15,
children: [ text, image ]
children: [ text, alignBox ]
} );
}

Expand Down

0 comments on commit 113f626

Please sign in to comment.