# U3.14 getting text in front of sprite

**URL:** <https://forum.code.org/t/u3-14-getting-text-in-front-of-sprite/22352>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-14\
**Created:** [November 19, 2018, 3:41pm UTC](https://forum.code.org/t/u3-14-getting-text-in-front-of-sprite/22352 "2018-11-19T15:41:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmgust](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mmgust](https://forum.code.org/u/mmgust)\
**Post date:** [November 19, 2018, 3:41pm UTC](https://forum.code.org/t/u3-14-getting-text-in-front-of-sprite/22352/1 "2018-11-19T15:41:04Z")

</div>

My student has icicles as part of her background, but it is a sprite. How can she get words to appear IN FRONT of the icicles, or any sprite? We have played around with order but it doesn’t seem to matter. Thank you!

---

<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:** [November 21, 2018, 12:12am UTC](https://forum.code.org/t/u3-14-getting-text-in-front-of-sprite/22352/2 "2018-11-21T00:12:57Z")

</div>

hi @mmgust!

Would you be able to share a link to the project?

thanks!  
Kevin

---

<div class="post-metadata">

**Author:** ![jold](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jold/32/5811_2.png) [@jold](https://forum.code.org/u/jold)\
**Post date:** [November 21, 2018, 3:11pm UTC](https://forum.code.org/t/u3-14-getting-text-in-front-of-sprite/22352/3 "2018-11-21T15:11:52Z")

</div>

If they all are sprites, its the order of creation that matters.  
The first one that gets created is always on the bottom.

```auto
var sprite2 = createSprite(200, 200);
sprite2.setAnimation("cow_1");

var sprite = createSprite(200, 200);
sprite.setAnimation("brown_cat_1");

```

Above, sprite will be in front of sprite2 because sprite was created after sprite2

Or  
You can change this later by using the depth property of the sprite.  
The higher the value of the sprite’s depth, the more in front it is.

Here is a little demo to show it.

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

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [November 21, 2018, 7:53pm UTC](https://forum.code.org/t/u3-14-getting-text-in-front-of-sprite/22352/4 "2018-11-21T19:53:04Z")

</div>

Another thing to note is that sprites are all drawn when the `drawSprites` command is used, so in order for plain text to appear on top of sprites, you will need to use the text command AFTER you use the drawSprites command.

Elizabeth
