Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Node2D
- var x = 1
- func _ready():
- pass
- func _draw():
- #draw_circle(Vector2(50,50),20,Color(255,0,0));
- x=x+10
- var center = Vector2(300, 300)
- var radius = 200
- var angle_from = -4*x
- var angle_to = x
- var color = Color(1.0, 0.0, 0.0)
- draw_circle_arc(center, radius, angle_from, angle_to, color)
- print(x)
- pass
- func draw_circle_arc(center, radius, angle_from, angle_to, color):
- var nb_points = 34
- var points_arc = PoolVector2Array()
- for i in range(nb_points + 4):
- var angle_point = deg2rad(angle_from + i * (angle_to-angle_from) / nb_points - 90)
- points_arc.push_back(center + Vector2(cos(angle_point), sin(angle_point)) * radius)
- for index_point in range(nb_points):
- draw_line(points_arc[index_point], points_arc[index_point + 1], color,2)
- func _process(delta):
- update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement