# Text and Background Sprites

**URL:** <https://forum.code.org/t/text-and-background-sprites/24402>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3\
**Created:** [January 28, 2019, 10:09pm UTC](https://forum.code.org/t/text-and-background-sprites/24402 "2019-01-28T22:09:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bross](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bross](https://forum.code.org/u/bross)\
**Post date:** [January 28, 2019, 10:09pm UTC](https://forum.code.org/t/text-and-background-sprites/24402/1 "2019-01-28T22:09:57Z")

</div>

Is there a way to have text appear on top of a background sprite?

---

<div class="post-metadata">

**Author:** ![kevinsukhoo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/kevinsukhoo/32/3617_2.png) [@kevinsukhoo](https://forum.code.org/u/kevinsukhoo)\
**Post date:** [January 30, 2019, 3:35pm UTC](https://forum.code.org/t/text-and-background-sprites/24402/2 "2019-01-30T15:35:36Z")

</div>

Hello @bross,

I think the order of code might be the issue. Take a look at [this sample project](https://studio.code.org/projects/gamelab/18XlIxNHaDMf1PNAI6MjDyMJY88M_ElObXr23pdmqdE).

Would you be able to share a link to the project you’re having issues with?

thanks!  
Kevin

---

<div class="post-metadata">

**Author:** ![bross](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bross](https://forum.code.org/u/bross)\
**Post date:** [January 31, 2019, 7:22pm UTC](https://forum.code.org/t/text-and-background-sprites/24402/3 "2019-01-31T19:22:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bradleywellsashley](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bradleywellsashley/32/522_2.png) [@bradleywellsashley](https://forum.code.org/u/bradleywellsashley)\
**Post date:** [February 4, 2019, 1:29pm UTC](https://forum.code.org/t/text-and-background-sprites/24402/4 "2019-02-04T13:29:07Z")

</div>

Dawn,

Just two minor issues with the code you shared:

1.) the `.setAnimation` block should be done outside of the draw loop if you aren’t changing the animation - in your case, you aren’t because it’s the background.

2.) Since the text is on top of the sprite, you need to `drawSprites` first and then have your `fill`, `stroke`, `size`, and `text` afterwards.

Hope that helps!  
Brad

---

<div class="post-metadata">

**Author:** ![bross](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bross](https://forum.code.org/u/bross)\
**Post date:** [February 4, 2019, 3:26pm UTC](https://forum.code.org/t/text-and-background-sprites/24402/5 "2019-02-04T15:26:23Z")

</div>

Thanks so much. I just knew there had to be a way!!
