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).
It’s easiest in JavaScript – here’s an example drawing a box just offset from the bottom right corner of the screen with some sample content.
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 game.currentScene().camera.offsetX / 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).
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.
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 :).
@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
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.
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.