So I've been working on a chat feature for my game. The chat box background is hidden normally. It shows up when you hit Enter and then you're allowed to type in something to send. The desired effect is when you click somewhere outside of the box, the background becomes hidden again.
I binded Enter to select the input field and show the background, easy. But I'm having trouble hiding the background correctly. Using the scroll bar as well as clicking inside the chat box shouldn't hide the background. I've tried a bunch of different stuff, nothing really worked. How should I approach this?
The first image is the normal one, input field and background hidden, can't chat.
The second image is after you hit Enter, background shows up, you can type in the input field.