adding stage handling to card
This commit is contained in:
parent
1d8d0f76ec
commit
1060f7815f
|
|
@ -10,6 +10,8 @@ var noise: Noise = FastNoiseLite.new()
|
|||
var wiggle_tween
|
||||
var scale_tween
|
||||
|
||||
var on_stage = false
|
||||
|
||||
@export var text: String = "" :
|
||||
set (value):
|
||||
text = value
|
||||
|
|
@ -80,7 +82,7 @@ func _ready():
|
|||
_handle_wiggle(0)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
|
||||
if self.on_stage:
|
||||
if highlighted:
|
||||
_handle_wiggle(delta)
|
||||
|
||||
|
|
@ -104,16 +106,18 @@ func _on_focus_exited():
|
|||
print(self, "is not focused")
|
||||
|
||||
func _on_mouse_entered():
|
||||
if self.on_stage:
|
||||
if not Input.is_action_pressed("mouse_left"):
|
||||
highlighted = true
|
||||
if "handle_hover" in owner:
|
||||
owner.handle_hover(self)
|
||||
|
||||
func _on_mouse_exited():
|
||||
if self.on_stage:
|
||||
highlighted = false
|
||||
|
||||
func _on_input_event(viewport, event, shape_idx):
|
||||
|
||||
if self.on_stage:
|
||||
if event is InputEventMouseMotion:
|
||||
_move_card()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue