Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Text Renderers...
- CrystalStar-
-
100+ posts
Text Renderers...
http://scratch.mit.edu/projects/12067195
I've coded text renderers fine before, but this one seems to have multiple problems! ‘See inside’ to find scripts labelled A and B.
1. Sprite refuses to change to a size below 100.
The sprite sometimes will not change to a size below 100. Sizes above 100 always work fine.
To see this, run script A once. It works fine. (The top line is at size 75, and the bottom line is at size 100.) You can run script A again and again and it will work fine. However, after running A, run B once. It also works fine. Then run A once more, and the size has been messed up! (Whenever you run B, then switch back to A, then A will not run correctly.)
B never runs correctly unless A has been run just before. Running B again and again will cause broken sizes. Basically, A and B seem to be opposite. :p I don't know what's wrong, though. I clearly set the sprite to change sizes in the define block…
2. Some letters are rendered wrongly.
To see an example of this one, run script A. Instead of “XYZ” at the end, “XXX” is rendered. And “EF” in the same script is sometimes rendered as “EE”, depending on whether or not the size is correct.
I can fix this one by wrapping a “repeat 2” around the [switch costume to…] block, but shouldn't that really have no effect? o.0 (It's also slower, though.) Also, adding another ‘stamp’ block after the ones already there makes the script stamp X and Y / X and Z in the same position, but again, I don't think that should do anything…? Another way to fix this is by setting the custom block to run without screen refresh, but I thought the only differences there should be speed? (I'd rather not use this method, though, as it doesn't have the typewriter effect I want.)
—————
Strangely, I have another text renderer with pretty much the same script that works just fine.
http://scratch.mit.edu/projects/11541845
If anyone could tell me if something is wrong with my script I'd be very grateful.
I've coded text renderers fine before, but this one seems to have multiple problems! ‘See inside’ to find scripts labelled A and B.
1. Sprite refuses to change to a size below 100.
The sprite sometimes will not change to a size below 100. Sizes above 100 always work fine.
To see this, run script A once. It works fine. (The top line is at size 75, and the bottom line is at size 100.) You can run script A again and again and it will work fine. However, after running A, run B once. It also works fine. Then run A once more, and the size has been messed up! (Whenever you run B, then switch back to A, then A will not run correctly.)
B never runs correctly unless A has been run just before. Running B again and again will cause broken sizes. Basically, A and B seem to be opposite. :p I don't know what's wrong, though. I clearly set the sprite to change sizes in the define block…
2. Some letters are rendered wrongly.
To see an example of this one, run script A. Instead of “XYZ” at the end, “XXX” is rendered. And “EF” in the same script is sometimes rendered as “EE”, depending on whether or not the size is correct.
I can fix this one by wrapping a “repeat 2” around the [switch costume to…] block, but shouldn't that really have no effect? o.0 (It's also slower, though.) Also, adding another ‘stamp’ block after the ones already there makes the script stamp X and Y / X and Z in the same position, but again, I don't think that should do anything…? Another way to fix this is by setting the custom block to run without screen refresh, but I thought the only differences there should be speed? (I'd rather not use this method, though, as it doesn't have the typewriter effect I want.)
—————
Strangely, I have another text renderer with pretty much the same script that works just fine.
http://scratch.mit.edu/projects/11541845
If anyone could tell me if something is wrong with my script I'd be very grateful.

Last edited by CrystalStar- (Aug. 30, 2013 08:39:38)
- scubajerry
-
1000+ posts
Text Renderers...
Interesting.
Check out the remix I did
http://scratch.mit.edu/projects/12081279/
Click what is left of the B SCRIPT and look at the 3 debug statements I added.
The SET SIZE block doesn't appear to work until after the SWITCH COSTUME.
Check out the remix I did
http://scratch.mit.edu/projects/12081279/
Click what is left of the B SCRIPT and look at the 3 debug statements I added.
The SET SIZE block doesn't appear to work until after the SWITCH COSTUME.
Last edited by scubajerry (Aug. 30, 2013 11:05:43)
- CrystalStar-
-
100+ posts
Text Renderers...
Thanks for that! c: I'll move that block.
Any idea what's causing #2?
Any idea what's causing #2?
Last edited by CrystalStar- (Aug. 30, 2013 11:25:52)
- CrystalStar-
-
100+ posts
Text Renderers...
Your remix fixes it, but I don't see any changes to the switch costume block. 

- CrystalStar-
-
100+ posts
Text Renderers...
I did the SET SIZE after the CHANGE COSTUME.
I'm talking about the problem where XYZ is rendered as XXX. Your remix fixes that, but there are no changes to the ‘switch costume to’ blocks. I don't think the size would be related to this. :p
- scubajerry
-
1000+ posts
Text Renderers...
I did the SET SIZE after the CHANGE COSTUME.
I'm talking about the problem where XYZ is rendered as XXX. Your remix fixes that, but there are no changes to the ‘switch costume to’ blocks. I don't think the size would be related to this. :p
You are good at finding scratch bugs. I don't understand this one either, but if you put a SHOW at the start of your custom block and a HIDE at the end, it masks Scratch's bug.
- DadOfMrLog
-
1000+ posts
Text Renderers...
Huh, that's a really odd bug (the costume getting stuck on X, Y or Z).
It seems to be related to the “move _ steps” (in the X direction). If you put the costume change before it shifts the x position along, then everything works fine. But if the costume change is after the move then it gets ‘stuck’ on X, Y or Z (other costumes don't seem to be affected in the same way - haven't checked them all, though).
If you change the y position by anything (even zero) before the costume change then it also works…

It seems to be related to the “move _ steps” (in the X direction). If you put the costume change before it shifts the x position along, then everything works fine. But if the costume change is after the move then it gets ‘stuck’ on X, Y or Z (other costumes don't seem to be affected in the same way - haven't checked them all, though).
If you change the y position by anything (even zero) before the costume change then it also works…

Last edited by DadOfMrLog (Aug. 30, 2013 15:30:48)
- CrystalStar-
-
100+ posts
Text Renderers...
Huh, that's a really odd bug (the costume getting stuck on X, Y or Z).
It seems to be related to the “move _ steps” (in the X direction). If you put the costume change before it shifts the x position along, then everything works fine. But if the costume change is after the move then it gets ‘stuck’ on X, Y or Z (other costumes don't seem to be affected in the same way - haven't checked them all, though).
If you change the y position by anything (even zero) before the costume change then it also works…
I know. :p Is there something different about those particular costumes…?
E is also sometimes affected, but it's not as common. After running the script many times, I noticed XYZ also appears to work, rarely. Sometimes fully, (XYZ) sometimes not (XXZ).
- scubajerry
-
1000+ posts
Text Renderers...
I cleaned up my remix. I am going to submit it as a bug. http://scratch.mit.edu/projects/12081279/#editor
- scubajerry
-
1000+ posts
Text Renderers...
I also just posted this as a bug
This demonstrates a weird bug with a hidden Sprite http://scratch.mit.edu/projects/12090752/
When trying to render ABCDEFG, it works perfectly if the Sprite is showing. Lines 2,4
It renders EE, instead of EF when the Sprite is hidden. (Lines 1,3)
This demonstrates a weird bug with a hidden Sprite http://scratch.mit.edu/projects/12090752/
When trying to render ABCDEFG, it works perfectly if the Sprite is showing. Lines 2,4
It renders EE, instead of EF when the Sprite is hidden. (Lines 1,3)
- CrystalStar-
-
100+ posts
Text Renderers...
Oh. I thought it was dependent on whether or not the size was correct, not whether or not the sprite was hidden. Thanks for reporting the bugs, as well! I also just posted this as a bug
This demonstrates a weird bug with a hidden Sprite http://scratch.mit.edu/projects/12090752/
When trying to render ABCDEFG, it works perfectly if the Sprite is showing. Lines 2,4
It renders EE, instead of EF when the Sprite is hidden. (Lines 1,3)
Last edited by CrystalStar- (Aug. 30, 2013 19:13:02)
- Discussion Forums
- » Help with Scripts
-
» Text Renderers...