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

Messages - DiabeticWaffle

#1
Yeah I just expressed myself really poorly.Instead of giving an actual concrete example, I invented a silly one that doesn't leave much room for a satisfactory answer.What I actually wanted to describe is something akin to those gui-heavy games(such as StarCraft), where there's a "zone" where input is handled by the gui(some games lock camera movement when the mouse hovers over the gui, so that's where I got that example), and the other is basically the game "canvas".In that case, your idea of putting widgets in a container and just checking that container for mouse overlap seems to solve the problem.I don't plan on implementing a gui in that fashion on my project, just wanted to know more in case I need that feature in the future.
#2
Oh wow that was simple, thanks! I guess that's why I didn't find it in the forums & tutorials. :P
Now I have one more question: what about input that is handled continuouslyâ€"not through eventsâ€" such as in camera movement? How would I make it so that when the mouse hovers over the GUI those inputs are ignored? I know that widgets have MouseEntered and MouseLeft signals, but checking every widget doesn't sound like fun.There's a simpler solution that I'm probably too noobish to see.  :-\
#3
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?