godot-psd-training/UI/screenDoorOperate/screen_door_operate.gd

37 lines
1.2 KiB
GDScript3
Raw Normal View History

2024-04-30 16:02:08 +08:00
extends Window
func _on_screen_door_click_signal(screenDoor:ScreenDoor,mousePosition) -> void:
position = Vector2(mousePosition.x-100,mousePosition.y)
show()
func _on_close_requested() -> void:
hide()
##粘胶带
func _on_adhesive_tape_gui_input(event: InputEvent) -> void:
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
print('AdhesiveTape')
func _on_adhesive_tape_mouse_entered() -> void:
$PanelContainer/MarginContainer/VBoxContainer/MarginContainer/AdhesiveTape.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_adhesive_tape_mouse_exited() -> void:
$PanelContainer/MarginContainer/VBoxContainer/MarginContainer/AdhesiveTape.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)
##隔离带
func _on_isolation_strip_gui_input(event: InputEvent) -> void:
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
print('IsolationStrip')
func _on_isolation_strip_mouse_entered() -> void:
$PanelContainer/MarginContainer/VBoxContainer/IsolationStrip.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_isolation_strip_mouse_exited() -> void:
$PanelContainer/MarginContainer/VBoxContainer/IsolationStrip.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)