0 votes

This is my code

func _ready():
    pass

func _draw():
    draw_circle(Vector2(0,0),20,Color(1,1,1))

So I give the position to (0,0) which mean the top left corner of the screen, But the circle will draw in a different position.
Also for other position not working well.
Is it my problem or engine problem?

in Engine by (46 points)

1 Answer

+4 votes

(0, 0) doesn't mean top left corner of the screen, it means (0, 0) on the node where you're doing the drawing. For example, if you create a new scene with a basic Node2D and move the node around, you'll find the circle will draw wherever the node is positioned.

by (20,475 points)

You are right.
Thank you

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.
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 webmaster@godotengine.org with your username.