Cursor fix part 2
This commit is contained in:
@@ -3,7 +3,7 @@ extends Area2D
|
||||
@export var ShowMouse = false
|
||||
var old_mouse_pos = Vector2.ZERO
|
||||
var mouse_velocity = Vector2.ZERO
|
||||
@export var vector_length = Vector2(500,0)
|
||||
@export var vector_length = 100
|
||||
@export var vector_width = 5
|
||||
|
||||
var line_2d : Line2D
|
||||
@@ -83,14 +83,14 @@ func _on_area_exited(area: Area2D) -> void:
|
||||
|
||||
|
||||
func draw_vector():
|
||||
var vector_direction = Vector2().rotated(rotation)
|
||||
var vector_direction = Vector2.RIGHT.rotated(rotation)
|
||||
var start_point = line_2d.to_local(global_position)
|
||||
var end_point = line_2d.to_local(global_position + vector_direction + vector_length)
|
||||
var end_point = line_2d.to_local(global_position + vector_direction * vector_length)
|
||||
|
||||
|
||||
|
||||
line_2d.add_point(start_point,1)
|
||||
line_2d.add_point(end_point,2)
|
||||
|
||||
print("Draws the vector")
|
||||
print("Draws the vector\nStart %s\nEnd: %s\nDirection %s" % [start_point, end_point, vector_direction])
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user