Sign in to follow this  
Plethora

Quick question

Recommended Posts

Plethora    687
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
extralongpants    704
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this