-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
(This is related to #128, but is partially specific to 1.4 SBs which were imported to 2.0, then loaded in 3.0.)
Expected Behavior
The costume's text displays; for example:
Actual Behavior
The costume's text does not display:
Steps to Reproduce
- Create and upload a 1.4 project that has a costume containing text, and have this project be saved as an SB2 (on the Scratch servers). I've already created a project you can use to test (so you don't need to go through all these steps).
- Open Scratch 1.4. Edit (or add) a costume so that it has a text in it.
- Save the project (it'll be a
.sbfile). - Import the project into the online Scratch 2.0 editor.
- Make a note of the URL, and load the project into Scratch 3.0 (
#<project ID>).
- Look at the costume with the text in it. Note that the text doesn't appear.
Operating System and Browser
Linux / Debian (testing), Firefox 52.2.0.
Notes/thoughts
2.0 Implementation
If a costume has a 1.4 text in it, Scratch 2.0 actually gives the costume two images: the baseLayer and the textLayer. That means there's four respective JSON fields:
{
"baseLayerID": <id>,
"baseLayerMD5": <md5>,
"textLayerID": <id>,
"textLayerMD5": <md5>
}
In the Scratch 2.0 editor, this makes it act as a vector image. For example, given this 1.4 costume:
..the costume displays as this vector image, in 2.0's costume editor:
Note that the text is displayed in Helvetica in the paint editor, but in the actual player it's displayed as it looks in Scratch 1.4:
However, as soon as it's changed, the player shows it in Helvetica (that is, exactly as it appears in the vector editor):
Flattening
However, flattening the vector image -- that is, clicking on "bitmap editor" -- without editing it, converts it to how it looks in 1.4:
Flattening is really just concatenating the base layer and text layer images (as gotten from the project JSON) together.
Intended behavior?
Perhaps the image should be flattened as soon as 3.0 sees it, rather than imported as a "pseudo-vector" costume. It's confusing for the image to display as a vector in 2.0, and for the font to change as soon as you edit the text. It's also complex to implement; there'd need to be a separate way of rendering these pseudo-vector costumes, since they're actually two bitmap images. (Rendering two images could also be slower performance-wise?)
I'd argue that flattening the images should be the behavior of 2.0 as well, but scratch-flash is now deprecated/frozen.
This is, of course, only a problem for 1.4 projects which were uploaded to and edited in the 2.0 editor, but those do exist; epninja's projects come to mind. For example, in Extreme Ninja Parkour, the text at the bottom of the first screen is from 1.4 and does not display in 3.0.






