Hello, I am trying to build some simple GUI widgets in SFML 2.1. I am using a RectangleShape as a text entry box. When the user clicks the mouse, I check if it is within the RectangleShape 's GlobalBounds. This check works as long as I don't resize the window. If I resize the window, the displayed shape gets distorted, but the GlobalBounds remains unchanged. Then when I click on the displayed rectangle, the mouseButton event's coordinates are not contained in the RectangleShape's GlobalBounds.
I tried using the RectangleShape 's LocalBounds and the TextureRect, but those don't work either. To be clear, I want to be able to resize my window and have the RectangleShape resize with it. But when that happens, how can I check to see if a mouse click is within the bounds of the RectangleShape?