Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor out label code for MassTag #102

Closed
zepumph opened this issue Feb 19, 2024 · 4 comments
Closed

Factor out label code for MassTag #102

zepumph opened this issue Feb 19, 2024 · 4 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Feb 19, 2024

While working on #96, I was asked for:

Put the colors on the A and B labels. I know that we discussed changing the colors of that labels, but for now, let's put them the same color that the other screens, blue for B and red for A.

And what I ended up finding was a lot of very connected, hard coded, duplicated, and confusing code that I would like to tease out. Basically the label for the numeric mass of an object, and the label/name for the mass, are kinda overloaded. MassLabelNode is doing both, but really it should just be working for the readout of the mass of the mass. I'd like to make a new type for MassTagView, the quad that provided the label to THREE for the name of the object (A/B/1A...).

Furthermore, there was awkard logic special to if it was primary/secondard vs a custom other tag. This made the color change request really challenging. I'll clean up the code before adding support for any MassTag to have its own custom color.

@zepumph zepumph self-assigned this Feb 19, 2024
@zepumph zepumph mentioned this issue Feb 19, 2024
3 tasks
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Feb 19, 2024
@zepumph
Copy link
Member Author

zepumph commented Feb 19, 2024

Getting pretty close, but not quite there yet:

image

phet.densityBuoyancyCommon.DensityBuoyancyCommonStrings.massLabel["1aStringProperty"].value = '22fdsafdsa2'

zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Feb 19, 2024
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Feb 19, 2024
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Feb 19, 2024
@zepumph
Copy link
Member Author

zepumph commented Feb 19, 2024

Ok, we are at a good stopping point. Next we can make custom colors for different MassTag. I also feel like we may want to change MassTag to a class instead of an enum for better flexibility.

@zepumph
Copy link
Member Author

zepumph commented Mar 4, 2024

Good progress here, but I shelved the changes locally and will need to come back to it.

zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/mobius that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/axon that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/scenery that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/axon that referenced this issue Mar 4, 2024
zepumph added a commit to phetsims/axon that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/mobius that referenced this issue Mar 4, 2024
…uoyancy#102

Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 4, 2024
…uoyancy#102

Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 4, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
@zepumph
Copy link
Member Author

zepumph commented Mar 4, 2024

Alright. I finally got to a commit point. This means that we now have a new file called MassTag, a new serialization for PhET-iO, and much more flexibility about how to provide the desired color for a mass tag (from the model side. It also meant that the task in #96 ended up being one line of code, which is definitely a great thing! We also were able to improve the mobius code quite a bit, making it more dynamic, since that is the direction that our code base (and design requests) is heading towards.

Closing

@zepumph zepumph closed this as completed Mar 4, 2024
zepumph added a commit to phetsims/density-buoyancy-common that referenced this issue Mar 5, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant