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)
in Engine by (157 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?

1 Answer

0 votes

You may be using a shader material, which affects the color of the shape that you drew.

by (14 points)
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.