This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
ld49/level/Interactable.gd
2021-10-03 07:41:01 +03:00

22 lines
593 B
GDScript

class_name Interactable
extends Area
export(Resource) var activity
func _ready() -> void:
connect("mouse_entered", self, "hover")
pass
func hover() -> void:
# TODO: add outline effect to the object
# NOTE: make sure there is only one object outlined at a time
pass
func _input_event(camera, event, click_position, click_normal, shape_idx):
if !(event is InputEventMouseButton) or event.button_index != BUTTON_LEFT or !event.pressed:
return
print("getting an input event")
if activity and activity is Activity:
print(activity)
get_node(@"/root/Game").set_activity(activity)