Disabling calling the function _draw() at the start

Godot Version

Godot 4

Question

How can I disable the automatic one-time call to the _draw() function at the beginning?

1 Like

dont set the node/CanvasItem to visible, yet?

I want to draw something but i don’t want to draw it automatically at the start

what does it draw from the start?

Why should it not draw at the start? Please explain your use case, what are you trying to accomplish?

I have a game where it draws something later not on the first seconds of the game

Then hide those nodes until you’re ready?

I just want to disable auto-start of the function draw()
I did that using:

var is_first_start(): bool = true

if is_first_start:
	is_first_start = false
	return

Maybe you know better way to do this? But I think this is good

Why? Why not just hide them? If you don’t want to draw them just hide them instead

easier

How is it easier to write your own method instead of just hiding them in the editor and show them when you’re ready?

But I don’t want that

So you want them to be shown, but not drawn? What’s the difference?

I don’t want to draw either show this, if it would try to draw, the game would crash because you need to type an expression or something. And in the start I don’t need to draw graph

So if its hidden it doesn’t draw? So you want it to be visible but not drawn?

I just don’t want it to draw something at the start

When do you want it to draw? Also you might want to make sure it can draw then, instead of trying to patch the issue

You don’t need to help me now, I found a way to do it.
I want to draw graph when player typed an expression after clicking the button but I also figured out how to do it

1 Like