do the same for post-its
This commit is contained in:
parent
4800acd15b
commit
bc7c2d6b6d
|
|
@ -44,7 +44,12 @@ var modulate_tween
|
|||
@export var is_dragable: bool = false
|
||||
@onready var base_rotation = rotation
|
||||
@onready var base_scale = scale
|
||||
var is_dragged = false
|
||||
var is_dragged: bool = false:
|
||||
set(dragged):
|
||||
is_dragged = dragged
|
||||
z_index = int(dragged)
|
||||
|
||||
var mouse_offset: Vector2
|
||||
|
||||
func _ready() -> void:
|
||||
|
||||
|
|
@ -85,11 +90,12 @@ func _on_input_event(viewport, event, shape_idx):
|
|||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
if is_dragable and "handle_mouse_button" in owner:
|
||||
mouse_offset = (get_viewport().get_mouse_position() - global_position)
|
||||
owner.handle_mouse_button(self, event)
|
||||
|
||||
func _move_post_it():
|
||||
if is_dragged:
|
||||
position += get_viewport().get_mouse_position() - position
|
||||
position += (get_viewport().get_mouse_position() - position) - mouse_offset
|
||||
|
||||
func is_postit_attached() -> bool:
|
||||
if self.get_parent().get_meta("type") == "card":
|
||||
|
|
|
|||
Loading…
Reference in New Issue