Maybe. Depends on how you scaled it and which options you choose. Control nodes behave different if they are under a Container node.
For the simplicity, I would add a Panel first and your RightClickInventory scene under it to test if the disappearing works, then implement the item grid to the panel later.
Is your Background node stretched on the full screen as well? Because if so, it will block this signal. You need to move this Control node after the Background node.
And remove this whole Area2D at the end too, it might be messing with the input as well
Please try to do these:
1- Remove Area2D and collisionshape2d. You should never need that under control node
2- Your code seems to be attached to node named Control node. So your mouse needs to get signal from that node. Why do you have that node? I donât think you need it.
3- Remove the node named Control
4- Attach your code to your node named Background
The Area2D was from a previous build and has been removed.
The code working on Control is how I am setting it up while trying wchcâs recommendations.
I tried switching the code to the Background, but nothing changed. It works the same as having it on Control. Also has the same problem where the exit signal also calls when the mouse enters the area
I think because the buttons are getting the signal so you are effectively leaving the area of the node:
1- Remove the node named Control
2- Attach your script to the node named Background
3- Make VBoxContainer (with its children) as a child of Background.
Unfortunately that makes it so if I hover over any of the buttons, it counts as leaving the background area. So that signal that I left the box would still be sent
For all the buttons, you should also select Mouse filter â Pass
Normally buttons default Mouse filter is Stop. Which means when your mouse is over a button, mouse event does not propogate up to the parent node. Because of that your main node (background) thinks the mouse is not on it anymore.
Make sure same is selected for the Vboxcontainer. Itâs mouse filter is Pass by default, so it should be ok. But just check just in case.
I know whatâs up now. You should expand your root note âRight_Click_Inventoryâ to stretch to the Full Rect as well.
It might not look correctly, but youâd need to adjust the look later once you get this working.
@lastbender is suggesting a similar approach, but just made it all in a tree structure, whereas mine was more flat.
Itâs a mess when 2 people reply at the same time, so Iâll just let @lastbender guide you further.
Only problem now is the Background doesnât show the texture that I picked? The bounds are still there and working,as far as I can tell the code is working completely correctly.
Haha yeah its been interesting to get two people trying to help. but it looks like lastbenderâs suggestion of the way to build the scene has worked! well, almost entirely, I canât see the image. But the code is working fine.
The only real trouble is that I donât really understand why that code is working, and the stuff we have been trying doesnât. I mean Iâll take the win, but would still love to know what is going on with it.