16 lines
510 B
GDScript3
16 lines
510 B
GDScript3
|
extends WindowDialog
|
||
|
|
||
|
var old_mouse_position = Vector2( 0, 0 )
|
||
|
|
||
|
|
||
|
func _on_stats_window_gui_input(event):
|
||
|
|
||
|
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and Input.is_mouse_button_pressed( BUTTON_LEFT ):
|
||
|
self.old_mouse_position = event.position
|
||
|
|
||
|
if event is InputEventMouseMotion and Input.is_mouse_button_pressed( BUTTON_LEFT ):
|
||
|
var delta = self.old_mouse_position - event.position
|
||
|
self.set_position( self.get_position() - delta )
|
||
|
|
||
|
|