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).
There’s not currently a great way to do this in just blocks, unfortunately. You can create a sprite and place it an offset as you mentioned, but the offsets of the camera (available as
Y) aren’t directly accessible in blocks, and the tile map constrains the camera in a way that you won’t likely be able to easily deal with in blocks at the moment.
I’ll see if there’s anything we can do to make this easier (I suppose at the very least I can make a quick extension exposing a few more blocks for things like
scene.createRenderable for doing simple UIs).
It would be nice to start making our hud more pluggable/customizable.
Thanks for the response!
I think having blocks for this would be terrific for beginners.
I was thinking about something along the lines of a block for “gluing” a sprite to one of the edges of the physical screen.
Something like “glue mysprite to (edge) of screen” where
edge := top | bottom | left | right | top-left | top-right | bottom-left | bottom-right
For top|bottom|left|right the sprite can be placed in the middle of the indicated edge.
Also, the sprite should have the highest Z value, so it is on top of everything else.
Hope other people find this useful too.
Oh, an absolute position for sprites on the screen is definitely an interesting idea. Worth noting the z index is already exposed in blocks (its in the same dropdown as
set x /
change x by).
The sprites category is already a bit packed, so we generally have to be careful about adding new blocks - each one we add makes it slightly less likely someone will find the block they need when they start looking. I’ll try and get a quick start on a simple extension for this sort of thing that we can iterate on :).
Thanks so much for even considering this.
@jwunderl @peli this sounds like a great candidate for an extension. It would also let us finally make a “put this text on the screen” block instead of using splash for everything
We should rewrite our HUD as an extension (internally) so that we know that someone else can inject a different HUD implementation.
i have a method that takes no extensions but a lot of blocks, us a set mysprite into the hud that you prefer then use the "place mysprite to place it into whatever edge of the screen set control mysprite with buttons and then set mysprite stayinscreen to ghost so that it goes through the walls of your tile map and set your main character as whatever and set camera follow maincharacter.
also btw if you want to be able to add items into the hud you can add more sprites with the same settings also because i dont think i said this you also have to have the main charatcer have set movewith buttons.
Could you use the relative to camera block?
well what do you mean by that
ok my account is trusted now, i just wanted to say yes relevant to camera works and also i saw your game otherworldly and i want to help ill continue this conversation on your otherworldly post.