Added Polygon debug drawing
Added drawing the polygon points for the Mouse Passthrough.
This commit is contained in:
parent
1373d8decb
commit
208c24173a
1 changed files with 11 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ extends Node2D
|
|||
class_name DebugDraw
|
||||
|
||||
var points: PackedVector2Array
|
||||
var polygon: PackedVector2Array
|
||||
|
||||
func _draw() -> void:
|
||||
points = Globals.get_exception_points()
|
||||
|
|
@ -13,8 +14,18 @@ func _draw() -> void:
|
|||
draw_line(slice[2], slice[3], Color.GREEN, 1.0, true)
|
||||
draw_line(slice[3], slice[0], Color.GREEN, 1.0, true)
|
||||
i += 4
|
||||
|
||||
polygon = Globals.get_polygon_points()
|
||||
for j in polygon.size():
|
||||
if j+1 > polygon.size()-1:
|
||||
draw_line(polygon[j], polygon[0], Color.RED, 1.0, true)
|
||||
else:
|
||||
draw_line(polygon[j], polygon[j+1], Color.RED, 1.0, true)
|
||||
|
||||
func _process(_d: float) -> void:
|
||||
var current := Globals.get_exception_points()
|
||||
if current != points:
|
||||
queue_redraw()
|
||||
current = Globals.get_polygon_points()
|
||||
if current != polygon:
|
||||
queue_redraw()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue