- Edited
- Best Answerset by druboi
druboi If I have say , 200 polygon2d nodes then are all of them re-rendered every frame ?
Yes, but the engine employs a number of optimizations to draw only what is actually needed.
How can I know if a Node was redrawn ?
If it's on screen - it is redrawn.
Is there a method that is called before a node is redrawn ?
_process()
is called every frame. You can track the visibility of a visual node using visibility notifications and enable/disable the _process()
accordingly. Note that for 2D (i.e. canvas items) there are two stages to "drawing it". One is creating its final texture (which may not happen every frame depending on the node type) and other is putting it onto final framebuffer (which happens every frame if the node is visible by the camera i.e. not culled). The former you can intercept by draw notification while the latter you can't.
Is there a way to prevent a Node from re-rendering ?
What exactly you're set to accomplish here?