Quick question
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.
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).
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).
you will have to handle this yourself manually like extralongpants suggests. There is not automatic way for SDL to handle this.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement