Bit of help needed for Resizeable window within a game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

So basically im trying i guess, remake an OS within a game engine for a game im working on, i have it so i can resize the window From the Right and bottom, but right now i cant figure out how to Be able to resize it from the Left and top without the length/height moving position

Here’s My Code so far, any Ideas as to How i could do this?

extends Panel

# member variables here, example:
# var a=2
# var b="textvar"

func _ready():
	set_fixed_process(true)
	pass

func _fixed_process(delta):
	var WindowTop = get_node("Top")
	var WindowOutline = self
	var St_L = get_node("Strech_Left")
	var St_R = get_node("Strech_Right")
	var St_U = get_node("Strech_Up")
	var St_D = get_node("Strech_Down")
	var Drag = get_node("Drag")
	var mouse_pos = get_global_mouse_pos()
	var mx = mouse_pos.x
	var my = mouse_pos.y
	
	
	##Right Dragging
	if St_R.is_pressed():
		WindowOutline.set_size(Vector2(mx - WindowOutline.get_pos().x +5, WindowOutline.get_size().height))
		WindowTop.set_size(Vector2(WindowOutline.get_size().width, WindowTop.get_size().height))
		St_R.set_pos(Vector2(WindowOutline.get_size().width-7, St_R.get_pos().y))
		St_U.set_size(Vector2(WindowOutline.get_size().width, St_U.get_size().height))
		St_D.set_size(Vector2(WindowOutline.get_size().width, St_D.get_size().height))
		Drag.set_size(Vector2(WindowOutline.get_size().width, Drag.get_size().height))
		
		##Down Dragging
	elif St_D.is_pressed():
		WindowOutline.set_size(Vector2(WindowOutline.get_size().width, my - WindowOutline.get_pos().y +13))
		St_R.set_size(Vector2(St_R.get_size().width, WindowOutline.get_size().height-41))
		St_L.set_size(Vector2(St_R.get_size().width, WindowOutline.get_size().height-41))
		St_D.set_pos(Vector2(St_D.get_pos().x, my - WindowOutline.get_pos().y))
:bust_in_silhouette: Reply From: The_Duskitty

Found the answer to my problem by using the get_margin and set_margin Rather than x, y, length, and height properties

So this is Solved :stuck_out_tongue_winking_eye: