Hi
I'm collaborating with my nephew on an isometric RTS style game using Godot and GdScript and we're stuck on making the screen scroll as we want. He's got keyboard scrolling working fine, and i've used this so far to make it scroll with the mouse moving, but it's far from as we would like it to be.
func _process(_delta):
if(get_viewport().get_mouse_position()):
self.position = get_viewport().get_mouse_position()
What i'm after is that when the mouse moves to the edge of the screen, whether it be up / down / left or right, the screen scrolls in that direction, until the mouse is no longer going that way. I did get it scrolling while holding either the left or right mosue buttons down but they will be needed for building / sprite selection and placement so can't use that for the actual game.
Any ideas on how to implement the above ?
Thanks in anticipation :)