Building windows to look at


I do not know how many times I have written some kind of window system for moving widgets around in different game engines but this is the most elegant.


extends Control  var held = {"l":false, "r":false, "m":false}  func _gui_input(event): 	 	#held 	if event is InputEventMouseButton: 		match event.button_index: 			BUTTON_LEFT:  held.l = event.pressed 			BUTTON_MIDDLE:  held.m = event.pressed 			BUTTON_RIGHT:  held.r = event.pressed 	 	#drag 	if event is InputEventMouseMotion: 		if held.l:  rect_position += event.relative 		if held.m:  pass 		if held.r:  rect_size += event.relative

Files

godot+util+desktop.zip 17 kB
Oct 09, 2018

Get Godot Desktop Toolkit

Leave a comment

Log in with itch.io to leave a comment.