Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - DiabeticWaffle

#1
Hey y'all! I'm a newcomer here and I would like a little help. :)
Here's the situation: I'm making an electric field simulation in which the user is able to create "charges"(represented by sf::CircleShape) in real-time.When he clicks anywhere on the SFML canvas, keeping the mouse button pressed, he is able to drag a "velocity vector" that points from the initial click to the current position of the mouse. As soon as he releases the left mouse button, the newly created charge will have a velocity represented by that vector.
Now onto the actual problem: once I click on a GUI element, say a button, that same behavior is repeatedâ€"so the user ends up accidentally creating a charge.What I actually want is for the simulation to ignore the mouse click & release altogether, but I don't know how to do it.
How should I go about implementing that?