Jump to content
  • Advertisement
Sign in to follow this  
Plethora

Quick question

This topic is 3907 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way using SDL to make a mouse click register only on the "top" surface? I'm trying to make a simple pop up menu which I have done successfully, however when I click the menu options my click registers both in the "top" surface (ie the menu) and on the game map underneath it. I've read through the documentation and the only thing that made any sense was making an overlay, but almost every mention of overlays that came up in google involved video of some sort, and that is not what I am looking for at all.

Share this post


Link to post
Share on other sites
Advertisement
I am by no means an expert in SDL, but I doubt there is an easy way to achieve this.

However, if your menu boundaries are simply shaped (rectangular or circular), you can just test whether or not the mouse pointer is in your menu region manually. Testing whether or not your menu is open and then whether or not the cursor is inside of it shouldn't be too difficult, unless you have some very oddly shaped menus (and even then it should be doable).

Share this post


Link to post
Share on other sites
you will have to handle this yourself manually like extralongpants suggests. There is not automatic way for SDL to handle this.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!