otorp2

drawline

Mar 29th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. extends Node2D
  2. var draw_list = []
  3.  
  4. func _ready():
  5. set_fixed_process(true)
  6. set_process(true)
  7. draw_list = [Vector2(0, 0), Vector2(250, 10), Vector2(50, 300), Vector2(500, 500)]
  8.  
  9. func _fixed_process(delta):
  10. pass
  11.  
  12. func _process(delta):
  13. update()
  14.  
  15. func _draw():
  16. if draw_list != []:
  17. var temp_draw_list = []
  18. for ob in draw_list:
  19. temp_draw_list.append(ob)
  20. if temp_draw_list != []:
  21. if temp_draw_list != draw_list:
  22. draw_line(temp_draw_list[temp_draw_list.size()-1], draw_list[temp_draw_list.size()], Color(1.0, 1.0, 0.5, 1.0), 3)
  23. print(ob)
Add Comment
Please, Sign In to add comment