blob: 61896f9df05d5a88fa19a715505f2881fbf3ddf8 (
plain) (
tree)
|
|
extends Node
var drawing = false
@onready var line: Line2D = $TrackLine
@onready var path: Path2D = $TrackPath
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func start_drawing():
reset()
drawing = true
func _end_drawing():
drawing = false
owner.set_driving(true)
func _input(event):
if drawing and event is InputEventMouseMotion:
line.add_point(event.position)
path.curve.add_point(event.position)
func reset():
line.clear_points()
path.curve.clear_points()
|