Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func _draw():
- var minX = floor(min(start.x, end.x))
- var maxX = floor(max(start.x, end.x))
- var minY = floor(min(start.y, end.y))
- var maxY = floor(max(start.y, end.y))
- var width = maxX - minX
- var height = maxY - minY
- for y in range(height): #might need adjustments for first or last pixel
- var x = floor((y/height) * width) #x offset
- #didn't find draw_point so this is a workaround
- var point = Vector2(minX + x, minY + y)
- draw_line(point, point+Vector2.RIGHT, Color.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement