# Overlay Help

**URL:** <https://forum.makecode.com/t/overlay-help/807>\
**Category:** Arcade\
**Created:** [November 21, 2019, 1:47pm UTC](https://forum.makecode.com/t/overlay-help/807 "2019-11-21T13:47:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DragonMountainDesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dragonmountaindesign/32/278_2.png) [@DragonMountainDesign](https://forum.makecode.com/u/DragonMountainDesign)\
**Post date:** [November 21, 2019, 1:47pm UTC](https://forum.makecode.com/t/overlay-help/807/1 "2019-11-21T13:47:36Z")

</div>

> **[GrassMan-AbilitiesDemo](https://arcade.makecode.com/36126-58593-75593-83023)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I’m trying to get my 10yo nephew interested in using MakeCode to make his own video games and finally struck a chord by asking if he wanted to work on a video game together about the superhero he created and has been writing about for the last few years.

After some discussion, he wants the character to have a couple different attacks: a melee attack and a blast attack. My thought is to have a general melee attack when the B button is pressed, and when enough energy is absorbed, a B button press will shoot a blast.

I’ve made some decent progress on including both forms of attack, and have gotten a power-indicator “overlay” sprite to show the power level, but I’m having trouble figuring out how to get it to stay in the same place on screen regardless of where the player sprite is.

Any help would be fantastic. Thanks!

---

<div class="post-metadata">

**Author:** ![arivera](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@arivera](https://forum.makecode.com/u/arivera)\
**Post date:** [November 21, 2019, 4:22pm UTC](https://forum.makecode.com/t/overlay-help/807/2 "2019-11-21T16:22:21Z")

</div>

Here is a related discussion, wit a solution using JavaScript -Cheers.

> [@HUD and Inventory for large tile maps](https://forum.makecode.com/t/hud-and-inventory-for-large-tile-maps/644):
>
> Hi there, I am new to Arcade, and loving it. Is there a way to have an HUD “glued” to one of the edges of the screen while Player sprites “walks” around in a large tile map? I want to keep inventory, and other status info, always visible, and I decided to ask before hacking this (if you can get the location of the camera, for example, you could place this info at an offset, but there seem to be no blocks to get this info). Thanks!

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [November 21, 2019, 6:57pm UTC](https://forum.makecode.com/t/overlay-help/807/3 "2019-11-21T18:57:34Z")

</div>

There is no way to do this in blocks. I think that I might add a SpriteFlag that prevents the camera from affecting a sprite; something like `SpriteFlag.FixedCamera` that you could set; would that work for you?

I’ll also propose some new camera blocks (but no promises)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [November 21, 2019, 9:41pm UTC](https://forum.makecode.com/t/overlay-help/807/4 "2019-11-21T21:41:40Z")

</div>

Just merged some new APIs: [https://github.com/microsoft/pxt-common-packages/pull/1013](https://github.com/microsoft/pxt-common-packages/pull/1013)

This adds two blocks for getting the camera position (`scene.cameraLeft()` and `scene.cameraTop()`) and adds a new flag `SpriteFlag.RelativeToCamera` that makes the sprite draw relative to the camera and not interact with other sprites or the tilemap.

It should show up in beta shortly

---

<div class="post-metadata">

**Author:** ![arivera](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@arivera](https://forum.makecode.com/u/arivera)\
**Post date:** [November 22, 2019, 2:26am UTC](https://forum.makecode.com/t/overlay-help/807/5 "2019-11-22T02:26:37Z")

</div>

Oh man, that is awesome.  
Thanks!
