@D-Ring said:
Ive put a scroll container in one of my popup windows (for a store) and everything works fine except have to grab the scroll bar to move it and cant just swipe with touch/mouse.
You may be able to implement swipe with touch/mouse using the _gui_event
function. In theory, the code would look like this:
var scroll_container;
const SCROLL_SENSITIVITY = 2;
var mouse_button_down = false
func _ready():
scroll_container = get_node("scroll_container");
func _gui_event(event):
# Check whether the left mouse button is pressed...
if (event is InputEventMouseButton):
if (event.button_index == BUTTON_LEFT):
mouse_button_down = event.pressed;
# Scroll with the mouse
if (event is InputEventMouseMotion and mouse_button_down == true):
scroll_container.scroll_vertical += event.speed
# Scroll with touch
if (event is InputEventScreenDrag):
scroll_container.scroll_vertical += event.speed
Though I have not tested the code, but that is more or less what I would try to do if I was going to implement swipe controls for scrolling. Hopefully it helps :smile:
Also is there a setting to dim the screen behind a popup or do i just need to put a modulated canvas layer that gets turned on/off with all popups
Unfortunately I do not think there is anyway to dim the screen behind a popup. I've always just used a semi-transparent Panel/ColorRect behind the popup, and/or a CanvasLayer, when I need to dim the screen.