extends TextureRect class_name BagSideCard var is_mouse_enter:bool=false var equip_index:int=0 signal click(data:Dictionary) var data:Dictionary={ "texture":"test_character_tsubaki" } # Called when the node enters the scene tree for the first time. func _ready() -> void: set_data(Global.get_item_data("item_01")) pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: pass func _input(event: InputEvent) -> void: if event.is_action_pressed("mouse_left") and is_mouse_enter: click.emit(data) func _get_drag_data(at_position: Vector2) -> Variant: var texture_rect=TextureRect.new() texture_rect.texture=Global.get_texture(data["texture"]) texture_rect.expand_mode=TextureRect.EXPAND_IGNORE_SIZE texture_rect.stretch_mode=TextureRect.STRETCH_KEEP_ASPECT_CENTERED texture_rect.size=self.size set_drag_preview(texture_rect) var new_data=data.duplicate(true) new_data["ind"]=equip_index return new_data func set_data(_data:Dictionary): data=_data %face.texture=Global.get_texture(data["texture"]) pass func _on_mouse_entered() -> void: is_mouse_enter=true click.emit(data) pass # Replace with function body. func _on_mouse_exited() -> void: is_mouse_enter=false pass # Replace with function body.