# Draw Loop, Sprite backgrounds, and Text

**URL:** <https://forum.code.org/t/draw-loop-sprite-backgrounds-and-text/35922>\
**Category:** Coding and Debugging Help\
**Tags:** csd-unit-3\
**Created:** [February 24, 2022, 5:47pm UTC](https://forum.code.org/t/draw-loop-sprite-backgrounds-and-text/35922 "2022-02-24T17:47:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmurr-pinsker](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@dmurr-pinsker](https://forum.code.org/u/dmurr-pinsker)\
**Post date:** [February 24, 2022, 5:47pm UTC](https://forum.code.org/t/draw-loop-sprite-backgrounds-and-text/35922/1 "2022-02-24T17:47:45Z")

</div>

> **[Check out what I made](https://studio.code.org/projects/gamelab/Gaj5Dm3ddd-WIh5uqrZPxkxlKIgKnFHTEksyDI5VLE8)**
>
> I wrote the code myself with Code.org

Hi All,  
I know I have posted about this before, and for some reason, I am still having trouble with text appearing once I add the draw loop- particularly when a sprite is used as a background. The background sprite here has been set outside the draw loop, so I don’t think it’s a case of the background “covering up” the text in the draw loop. I think I figured out that I have to have the text appear after I draw the bird sprite in the loop, but can anyone remind me why this is? Even if the bird sprite is drawn after, it’s in a different location than the text, so why, if I call the text first, will it not appear? I am very curious about the “whys” of coding. Thanks in advance!

> **[Check out what I made](https://studio.code.org/projects/gamelab/Gaj5Dm3ddd-WIh5uqrZPxkxlKIgKnFHTEksyDI5VLE8)**
>
> I wrote the code myself with Code.org

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [February 24, 2022, 8:14pm UTC](https://forum.code.org/t/draw-loop-sprite-backgrounds-and-text/35922/2 "2022-02-24T20:14:19Z")

</div>

@dmurr-pinsker,

Can you check that link and make sure you got it all? It won’t load for me, but if I can see it, I’m happy to try and explain what is happening.

Mike

---

<div class="post-metadata">

**Author:** ![dmurr-pinsker](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@dmurr-pinsker](https://forum.code.org/u/dmurr-pinsker)\
**Post date:** [February 24, 2022, 8:45pm UTC](https://forum.code.org/t/draw-loop-sprite-backgrounds-and-text/35922/3 "2022-02-24T20:45:34Z")

</div>

@mwood Thanks for getting back to me. I updated the links, so hopefully they work now.

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [February 24, 2022, 8:48pm UTC](https://forum.code.org/t/draw-loop-sprite-backgrounds-and-text/35922/4 "2022-02-24T20:48:43Z")

</div>

When I run your code as is, I can see “flying” appear in the upper left corner of the screen and it isn’t hidden by the background, so if I understand your explanation, I think you are correct.

If you wanted it to appear above the bird, it would have to be after the drawSprites, but in this case, they aren’t overlapping so you can see the text.

Mike
