phetsims / paper-land

Build and explore multimodal web interactives with pieces of paper!
https://phetsims.github.io/paper-land/
MIT License
10 stars 1 forks source link

setFontSize doesn't work for text component #219

Closed jessegreenberg closed 3 months ago

jessegreenberg commented 3 months ago

This didn't work as I expected:

setString( 'HELLO THERE ' + numberComponent );

setFontSize( 200 );

setCenterX( 300 );
setCenterY( 300 );

Whatever the value for setFontSize, nothing changes.

jessegreenberg commented 3 months ago

The fontSize setter from scenery is undefined. I am not sure why. I will try a new build of phet-lib to see if the problem goes away.

jessegreenberg commented 3 months ago

Fixed in main. It turns out RichText doesn't support setSize and setFontFamily, but it does support setFont, so this was fixed by creating a new Font object and setting it to the Text in the generated functions for size and family.

Closing.