Advertisement
otorp2

vector2array color array

Jan 9th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. draw_primitive(Vector2Array([Vector2(0,0),Vector2(100,300),Vector2(90,0)]),ColorArray([Color(1,1,0),Color(1,0,0),Color(1,0,0)]))
  2.  
  3.  
  4. func _process(delta):
  5. update()
  6. func _ready():
  7. set_process(true)
  8.  
  9. which doesnt draw anything and romullox_x kindly provided workaround:
  10.  
  11. extends Node2D
  12. var myColorArray = ColorArray()
  13.  
  14. func _draw():
  15. for color in [Color(1,0,0),Color(1,0,0),Color(1,0,0)]:
  16. myColorArray.push_back(color)
  17. draw_primitive([Vector2(0,100),Vector2(100,300),Vector2(90,0)], myColorArray)
  18. pass
  19.  
  20. func _process(delta):
  21. update()
  22. func _ready():
  23. set_process(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement