Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

So here's some initial progress on the HUD!


I got the red circle working last night, after learning about the built-in _draw() function for Nodes in Godot, and the draw_circle() function. What turned out to be more complicated than I expected was the hypothermia overlay. 

What Godot is doing here is

  1. Draw the player sprite and the heat circle
  2. Encountering a BackBufferCopy node, and caching what's been drawn to the screen so far
  3. Drawing a rectangular pale blue transparent overlay across the whole screen
  4. Drawing a white circle over that, with a shader that sets the texture of the circle to... that cached picture of the screen!


It seems bizarre to me, but after a lot of searching it seems to be the best method I can find. If anyone has a suggestion, though, I'd love to hear it! Obviously the structure of the node tree and the way the code is written is going to change, but I'm sticking the screenshot above in just in case someone else is using Godot and looks for a way to make a hole in a texture. I'd like to write this up into a more detailed example in the future, since it would've saved me a couple hours to have a detailed example of how to use the BackBufferCopy and shaders like this!