Skip to content

Commit

Permalink
pass in Properties to (Rich)Text instead of their string values, phet…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 26, 2022
1 parent abb2885 commit d9144a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/game/view/GameInfoBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GameInfoBanner extends Rectangle {
this.areaToFindProperty = new Property( null );

// Define the title.
const title = new Text( this.titleTextProperty.value, {
const title = new Text( this.titleTextProperty, {
font: TITLE_FONT,
fill: TEXT_FILL_COLOR,
centerY: height / 2,
Expand All @@ -54,8 +54,7 @@ class GameInfoBanner extends Rectangle {
this.addChild( title );

// Update the title when the title text changes.
this.titleTextProperty.link( titleText => {
title.text = titleText;
this.titleTextProperty.link( () => {
title.centerY = height / 2;
if ( this.buildSpecProperty.value === null && this.areaToFindProperty.value === null ) {
// There is no build spec are area to find, so center the title in the banner.
Expand Down

0 comments on commit d9144a4

Please sign in to comment.