TBOI HP Style/Camera

D

Dioramos

Guest
I want to make a room in center, and 16 grey pixels with HP and something around room (first screen). If it's small room, everything is okay, but in high room gray lines will be visible only at the edges of the room. I need this gray rectangle to always follow me, and health over it. How can i do it?
 

Attachments

I'm taking a guess that the way you've drawn your rectangle is by actually building it into the room as a border of tiles or perhaps just empty space around the edge. Is that correct?

If so what you can do is draw a rectangle in the gui event. Keep the border around the edge of your room.

I'm not sure if the green squares on the right side of the left picture are supposed to be visible. But if they are, then it will complicate things somewhat.

Please let me know if I'm mistaken about how you've been drawing your grey rectangle.
 
D

Dioramos

Guest
I'm taking a guess that the way you've drawn your rectangle is by actually building it into the room as a border of tiles or perhaps just empty space around the edge. Is that correct?

If so what you can do is draw a rectangle in the gui event. Keep the border around the edge of your room.

I'm not sure if the green squares on the right side of the left picture are supposed to be visible. But if they are, then it will complicate things somewhat.
It's just gray background, green tiles will be invisible in game. Thanks, I will try your method.
 

Yal

🍋 *lemon noises*
GMC Elder
"The GUI layer" / "The Draw GUI event" (which essentially are the same thing) is the recommended way to GUIs these days, so you definitely should look into that. The GUI layer is attached to the game window, not the view, and it's always drawn on top of everything else.
 
D

Dioramos

Guest
"The GUI layer" / "The Draw GUI event" (which essentially are the same thing) is the recommended way to GUIs these days, so you definitely should look into that. The GUI layer is attached to the game window, not the view, and it's always drawn on top of everything else.
My room size is 320x192. I made border's sprite, it's size 320x192 too. But... It's my DrawGUI event code. I tried to scale sprite, but its not 1:1 with room.
 

Attachments

Top