Let me explain what I mean. If I have static function in any script that extends CanvasItem
like this:
static func DrawLine():
draw_line(Vecor2(), Vector2(100, 100), Color.white)
That don't works because draw_line
isn't static. Ok, if that function isn't static it works only in script that contains this function in _draw()
method. But I want use this function in other node, child node for example. If I just write get_parent().DrawLine()
it will throw exception like draw functions can be used only in _draw() method
. Is it possible to use DrawLine()
method in other nodes on scene? Because my code is longer than example, and repeat it isn't good idea, because I will have problems with debugging and writing new code. Thanks for your answers!