Skip to content

Commit

Permalink
Remove peeled papers and grippy lines, see phetsims/make-a-ten#298
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Jun 15, 2021
1 parent 3fc006d commit ef063c8
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 156 deletions.
50 changes: 4 additions & 46 deletions js/common/view/BaseNumberNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

import Dimension2 from '../../../../dot/js/Dimension2.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import Shape from '../../../../kite/js/Shape.js';
import Image from '../../../../scenery/js/nodes/Image.js';
import Node from '../../../../scenery/js/nodes/Node.js';
import Path from '../../../../scenery/js/nodes/Path.js';
import imageDigit0 from '../../../mipmaps/digit-0_png.js';
import imageDigit1 from '../../../mipmaps/digit-1_png.js';
import imageDigit2 from '../../../mipmaps/digit-2_png.js';
Expand All @@ -26,16 +24,8 @@ import imagePaperBackground1000 from '../../../mipmaps/paper-background-1000_png
import imagePaperBackground100 from '../../../mipmaps/paper-background-100_png.js';
import imagePaperBackground10 from '../../../mipmaps/paper-background-10_png.js';
import imagePaperBackground1 from '../../../mipmaps/paper-background-1_png.js';
import peeledImagePaperBackground1 from '../../../mipmaps/peeled_paper_background_1_png.js';
import peeledImagePaperBackground10 from '../../../mipmaps/peeled_paper_background_10_png.js';
import countingCommon from '../../countingCommon.js';

// place => mipmap info
const PEELED_BACKGROUND_IMAGE_MAP = {
0: peeledImagePaperBackground1,
1: peeledImagePaperBackground10
};

// place => mipmap info
const BACKGROUND_IMAGE_MAP = {
0: imagePaperBackground1,
Expand Down Expand Up @@ -99,24 +89,10 @@ class BaseNumberNode extends Node {
// Translate everything by our offset
this.translation = baseNumber.offset;

let paperBackgroundImage;

// if the base number is a 1 that's not on top of a bigger base number, or if the base number is underneath smaller
// base numbers, then use a flat background instead of a peeled one.
if ( baseNumber.digit === 1 &&
( ( baseNumber.place === 0 && !isPartOfStack ) || ( baseNumber.place >= 1 && isPartOfStack ) ) ) {

// The paper behind the numbers
paperBackgroundImage = new Image( BACKGROUND_IMAGE_MAP[ baseNumber.place ], {
imageOpacity: opacity
} );
}
else {
paperBackgroundImage = new Image( PEELED_BACKGROUND_IMAGE_MAP[ baseNumber.place ], {
imageOpacity: opacity
} );
}
this.addChild( paperBackgroundImage );
// The paper behind the numbers
this.addChild( new Image( BACKGROUND_IMAGE_MAP[ baseNumber.place ], {
imageOpacity: opacity
} ) );

// The initial (non-zero) digit
this.addChild( new Image( DIGIT_IMAGE_MAP[ baseNumber.digit ], {
Expand All @@ -132,24 +108,6 @@ class BaseNumberNode extends Node {
y: y
} ) );
}

// TODO: these should be elminated with future designs, see https://github.com/phetsims/number-play/issues/19
// add the grippy lines if this number is on the top layer
if ( !( baseNumber.place >= 1 && isPartOfStack ) ) {

// empirically determined to put the grippy in the same place in relation to the paper number's digit
const yMargin = baseNumber.place >= 1 ? 90 : 56;
const lineLength = 100; // empirically determined
const lineSeparation = 15; // empirically determined
const grippyLines = new Path( new Shape()
.moveTo( 0, 0 ).lineTo( lineLength, 0 ).moveTo( 0, lineSeparation ).lineTo( lineLength, lineSeparation ).close(), {
stroke: 'rgb( 204, 204, 204 )',
lineWidth: 3,
centerX: paperBackgroundImage.centerX,
bottom: paperBackgroundImage.bottom - yMargin
} );
this.addChild( grippyLines );
}
}
}

Expand Down
16 changes: 0 additions & 16 deletions mipmaps/license.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,5 @@
"projectURL": "http://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "Created by Mariah Hermsmeyer"
},
"peeled_paper_background_1.png": {
"text": [
"Copyright 2016-2019 University of Colorado Boulder"
],
"projectURL": "http://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Mariah Hermsmeyer and Amanda McGarry"
},
"peeled_paper_background_10.png": {
"text": [
"Copyright 2016-2019 University of Colorado Boulder"
],
"projectURL": "http://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Mariah Hermsmeyer and Amanda McGarry"
}
}
Binary file removed mipmaps/peeled_paper_background_1.png
Binary file not shown.
Binary file removed mipmaps/peeled_paper_background_10.png
Binary file not shown.
47 changes: 0 additions & 47 deletions mipmaps/peeled_paper_background_10_png.js

This file was deleted.

47 changes: 0 additions & 47 deletions mipmaps/peeled_paper_background_1_png.js

This file was deleted.

0 comments on commit ef063c8

Please sign in to comment.