Godot-RTS-Template/Core/cursor_behaviour.gd

31 lines
1.2 KiB
GDScript3
Raw Normal View History

2025-07-18 15:44:53 +00:00
extends Node
## Handle all the cursor appareance related stuff.
2025-07-21 15:46:53 +00:00
const nav_e = preload("res://Packs/Kenney-cursors/Outline/navigation_e.svg")
const nav_n = preload("res://Packs/Kenney-cursors/Outline/navigation_n.svg")
const nav_ne = preload("res://Packs/Kenney-cursors/Outline/navigation_ne.svg")
const nav_nw = preload("res://Packs/Kenney-cursors/Outline/navigation_nw.svg")
const nav_s = preload("res://Packs/Kenney-cursors/Outline/navigation_s.svg")
const nav_se = preload("res://Packs/Kenney-cursors/Outline/navigation_se.svg")
const nav_sw = preload("res://Packs/Kenney-cursors/Outline/navigation_sw.svg")
const nav_w = preload("res://Packs/Kenney-cursors/Outline/navigation_w.svg")
2025-07-18 15:44:53 +00:00
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
2025-07-21 15:46:53 +00:00
func _on_player_root_cursor_edge_scrolling(direction: Vector2) -> void:
print("panning vector", direction)
return
if direction.length() > 0:
if direction.x > 0:
Input.set_custom_mouse_cursor(nav_e)
else:
Input.set_custom_mouse_cursor(nav_ne)