• 2D
  • Can't draw rect. What Am I missing?

So I have this function code on my primary scene. This is just a test to get something on screen:

extends Node2D

export var background_color: Color = Color(1,1,1)

func _ready():
	fill_background()

func _process(delta):
	fill_background()

func fill_background():
	draw_rect(get_viewport_rect(), background_color)

it does nothing. If I replace the body of fill beckground by:

var small_rect: Rect2 = Rect2(Vector2(0,0),Vector2(100,100))
draw_rect(small_rect, background_color)

it doesn't draw a small rect either. I can't draw lines either.

What am I missing?

Edit: Ok, I didn't see the terminal, didn't know about that. It turns out I can only draw in the _draw function

Looks like your post got stuck in the moderation queue. Make sure that you have verified your account's email.

@SIsilicon28 said: Looks like your post got stuck in the moderation queue. Make sure that you have verified your account's email.

I did verify, although I took a little time, it wasn't immediate.