Connect two buttons within an overlay using draw line function

Hello, I am trying to make a line that connects two buttons that are children of an overlay. I am trying to create a web based upgrade system and want lines connecting buttons. I tried searching this up and only found one that allows you to connect widgets with the draw line function. I have tried using slot as overlay but can’t get position using that. I know slot as canvas works but im trying to have the buttons in the overlay so they have a background image. I was wondering if there is a way to do this or if its impossible. I can provide images if needed.

1 Like
  • how do you position the children of the Overlay? With padding?
  • perhaps elaborate on this part, as not using a canvas here will make it tricky. Canvas is the only widget that immediately returns pixel coordinates. I feel solving the background issue will be an order of magnitude easier than fetching coords from an overlay.

Note that the Canvas is just a fancy (and somewhat expensive) widget, but nothing stops you from nesting a Canvas inside the Overlay:

Now your buttons live inside the canvas and the image fills the overlay as background. Would this work for you?

1 Like

Still got a problem. It lets me grab the position and i am able to draw a line but something seems to be off. I think it has to do with how I may have things set up. Here is the image for reference.


I am trying to make it so you can drag around and see more things with the scroll boxes but that may be messing up with the lines. Any input on how to maybe adjust this?

not sure if my last message was a reply or not but i was able to get the line to appear but seem to being have more issues. I have a screenshot in the other reply with more explanation.