# Speech Bubble Z (Depth)

**URL:** <https://forum.makecode.com/t/speech-bubble-z-depth/2662>\
**Category:** Arcade\
**Created:** [July 4, 2020, 8:26pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662 "2020-07-04T20:26:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [July 4, 2020, 8:26pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/1 "2020-07-04T20:26:05Z")

</div>

In my game, I have a sprite that is in front of everything. When I make him “Say” something, the speech bubble goes behind the other sprites. How do I fix this?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 5, 2020, 2:17pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/2 "2020-07-05T14:17:06Z")

</div>

I don’t think you can ☹

_Unless…_

You set all your other sprites to a `z` value of something like below `50`, because I think speech bubbles have a `z` value of `50`…

You should ask one of the forums admins for the exact number

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [July 5, 2020, 5:33pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/3 "2020-07-05T17:33:08Z")

</div>

Thanks! I set the other sprites to 1, 2, 3, 4, and 5, but it still doesn’t work. 🙁

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 5, 2020, 5:47pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/4 "2020-07-05T17:47:16Z")

</div>

Would it be possible for you to share your project? Maybe I can take a peek if you don’t mind 😉

@jwunderl said somewhere that the health and score bars had a `z` index of 100 or something like that.

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [July 5, 2020, 5:47pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/5 "2020-07-05T17:47:47Z")

</div>

okay!

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [July 5, 2020, 5:51pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/6 "2020-07-05T17:51:19Z")

</div>

Wait… It is working now!

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 5, 2020, 5:52pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/7 "2020-07-05T17:52:51Z")

</div>

Nice!

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [July 5, 2020, 8:13pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/8 "2020-07-05T20:13:32Z")

</div>

Huh, I don’t think we have actually set a z index for the say bubble, so it’s just at the default 0 irrespective of what the sprite it’s attached to is set at. That’s annoying / the wrong behavior, will fix it.

(here’s the change I put up: [https://github.com/microsoft/pxt-common-packages/pull/1129](https://github.com/microsoft/pxt-common-packages/pull/1129) )

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [July 5, 2020, 9:53pm UTC](https://forum.makecode.com/t/speech-bubble-z-depth/2662/9 "2020-07-05T21:53:43Z")

</div>

thanks!
