Skip to content

Commit

Permalink
Add halfStarScoreRange option to LevelCompletedNode.js. See phetsims/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Jan 6, 2024
1 parent f1368f6 commit 2ede4e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/LevelCompletedNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import GameTimer from './GameTimer.js';
import ScoreDisplayStars from './ScoreDisplayStars.js';
import vegas from './vegas.js';
import VegasStrings from './VegasStrings.js';
import Range from '../../dot/js/Range.js';

const DEFAULT_TITLE_FONT = new PhetFont( { size: 28, weight: 'bold' } );
const DEFAULT_INFO_FONT = new PhetFont( { size: 22, weight: 'bold' } );
Expand All @@ -35,6 +36,7 @@ type SelfOptions = {
buttonFont?: Font;
buttonFill?: TColor;
starDiameter?: number;
halfStarScoreRange?: Range | null;
contentMaxWidth?: number | null; // applied as maxWidth to every subcomponent individually, not Panel's content
};

Expand Down Expand Up @@ -70,6 +72,7 @@ export default class LevelCompletedNode extends Panel {
buttonFont: DEFAULT_BUTTON_FONT,
buttonFill: PhetColorScheme.BUTTON_YELLOW,
starDiameter: 62,
halfStarScoreRange: null,
contentMaxWidth: null,

// PanelOptions
Expand Down Expand Up @@ -106,6 +109,7 @@ export default class LevelCompletedNode extends Panel {
const scoreDisplayStars = new ScoreDisplayStars( new Property( score ), {
numberOfStars: numberOfStars,
perfectScore: perfectScore,
halfStarScoreRange: options.halfStarScoreRange,
starNodeOptions: {
starShapeOptions: {
innerRadius: options.starDiameter / 4,
Expand Down

0 comments on commit 2ede4e7

Please sign in to comment.