Commit bfb6bf82 authored by Julia Santos's avatar Julia Santos

Delete NewItem.gd

parent db072f51
extends StaticBody2D
onready var dialogueBox = get_parent().get_node("Panel/RichTextLabel")
onready var parent = get_parent()
onready var texture = get_node("CollisionShape2D/Sprite").get_texture()
#onready var clickLog = File.new()
# https://padamthapa.com/blog/how-to-detect-click-inside-staticbody2d-in-godot/
func _ready():
pass # Replace with function body.
func _input_event(viewport, event, shape_idx):
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
print("Clicked on " + self.get_name())
dialogueBox.text = "Clicked on " + self.get_name()
parent.get_inventory(self, texture)
queue_free()
#
#print("Clicked on " + self.get_name())
#dialogueBox.text = "Clicked on " + self.get_name()
#clickLog.open("res://log.txt",File.WRITE_READ)
#clickLog.seek_end(0)
#clickLog.store_string("Clicked on " + self.get_name() + "\n")
#clickLog.close()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment