Unit 3 Lesson 13- Why does text have to appear in draw loop?

Hi All- I have a question about text in the draw loop. I have noticed that when following the steps in Unit 3, Lesson 13 (or 12) that the text disappears when we use a draw loop unless I move the text (and text properties) into the draw loop. I am wondering why this is. Any insights appreciated!

This happens because of the way the “draw loop” works. When the draw loop runs it will redraw the background, and anything else inside the draw loop, over whatever is there. When the text is outside the draw loop, it will be there still but covered by the latest update in the draw loop. The draw loop continues to run and update the drawings at whatever Frame Rate is set.

I wasn’t able to look at the project you are referencing because the links are to the lesson pages. If I didn’t answer your question above, I would be happy to look at it. To share the project link click on the “share” button at the top left corner of the page and send that link.

1 Like

Hi Ceclia- This makes perfect sense, and sorry about the goofs on the links- this is what happens when I am rushing at night. In a similar vein, is this why, when you don’t have the background in the drawloop (as in the case of Unit 3, Lesson 12, Level 7 Step one-spinning pan) you see all of the past pan images (so it looks more like a rotating wheel than a spinning pan?)

1 Like

I totally understand and it happens all the time with the links.

Yes, that is why the pan looks like that. As soon as you put a background in, you will only see the most recent sprites. I tell my students in the draw loop for animation, 1. draw backgrounds, 2. update sprites and 3. draw sprites (and add text). Keeping it in that order helps the animation to go smoothly.

I explain it to my students that the “smudging” is happening because there’s nothing to cover up the previous version of the animation before the new version is drawn so you see all of them at once. If there’s a background at the top of the draw loop it covers up the previous animation before the new one is drawn. It’s kind of like the paper flip book showing handdrawn animations and how the previous page goes past before the new one is shown.

1 Like

Thank you for this advice! I will try sharing this “oder of operations” so to speak with my students.

1 Like

I love the term “smudging.” Thank you for this insight!