- Edited
Hello,
I need to draw an arc for a node, so I'm using this code:
func _ready():
for i in range(100 + 1):
var angle_point = deg2rad(270 + i * 90 / 100 - 90)
points_arc.push_back(Vector2(15, 15) + Vector2(cos(angle_point), sin(angle_point)) * 25)
func _draw():
for index_point in range(100):
draw_line(points_arc[index_point], points_arc[index_point + 1], Color(1, 1, 0), 5, true)
It's basically the code from https://docs.godotengine.org/en/stable/tutorials/2d/custom_drawing_in_2d.html but instead of calculating the points every time I moved it to ready.
However this code alone (executed on about 10 of those nodes) is enough to render the game a slideshow.
Is there any fast way to draw an arc? I wish there would be nodes to draw circles, arcs and such similar to ColorRect.