0 votes

I am using draw_line to draw a line across the screen. The color of the line, although fed Color.black, draws as white.
Code:

export (Color) var window_color : Color = Color8(0, 0, 0, 255)

for i in 128:
        draw_rect(Rect2(Vector2(window_1_memory[i*2], i), Vector2(window_1_memory[i*2 + 1], 1.0)), window_color, true)
asked Mar 25 in Engine by droc101 (38 points)

According to the title and the script you're drawing a rectangle. According to the accompanying text you're drawing a line. What is it?

The color of the line, although fed Color.black, draws as white.

I cannot reproduce this, here's my code and it's running fine:

export (Color) var window_color : Color = Color8(0, 0, 0, 255)

func _draw():
     draw_rect(Rect2(Vector2(0, 0), Vector2(200, 200)), window_color)

Well before I run that code, I'm drawing 4 other textures, and line by line changing the offset... Maybe it can't be done in one frame?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.