@latreides said:
@TwistedTwigleg said:
You can draw a part of a texture using a TextureRect and setting the texture region, if I remember correctly.
TextureRect does not have a texture region.
Yeah, I just looked as well and, yup, it's not there. I thought it was, but I must be misremembering. You can kinda get around this using a Panel node with a textured style box, but its probably not intended to be used this way.
@TwistedTwigleg said:
You can also use the draw
functions with Control nodes, though I'm not sure they will inherit the sizing and positioning benefits of Control-based nodes.
Will these benefit from batching as well?
I believe so, as _draw
is only called once at start and then whenever you call the update
function. I think it caches the result and uses that for subsequent draw calls. Though, I haven't looked into it recently and I don't remember for sure, so please take this with a grain of salt!
I wasn't aware of the the draw calls for the canvas items that @TwistedTwigleg mentioned, and reading up on them they seem to be a good solution for UI/HUD's because they don't often change every frame, is this a recommended way to draw persistent HUDs?
Probably is a decent way to draw them, though as long as your UI for your HUD isn't too complex, it probably won't have too much of a performance impact either way.