ID:1013354
 
(See the best response by Gunbuddy13.)
So I got an interesting problem here...

In my current project I have a screen object that creates screen flashes much like classic 90's FPS games - i.e. when you take damage, the screen flashes red.

The object is scaled to 496x496 at the beginning of the game, so it covers the entire map.

Now, the player can shoot using the mouse. When the mouse button is pressed or dragged, an angle is calculated based on the position of the atom they clicked on or dragged to.

The problem is that if you click or drag during the screen flash animation, the location of the click is of course the screen object at screen_loc = 1,1. So basically the player's aim will suddenly go wildly off course, shooting toward the bottom left corner instead of toward the mouse's position.

I can think of some solutions but I'm just wondering if there's something I am missing that will make it easier. Here's what I have thought of in terms of my options:

Option 1: Change the screen flash to just be a border around the outside of the map. This would be very easy, but wouldn't look nearly as cool. I'd like to avoid this.

Option 2: When the user is clicking or dragging on the flasher object, calculate the mouse position using the params icon-x and icon-y, and calculate the angle using that instead of a turf. (or find the turf they would have clicked on and use that). Seems like a good option but I'm worried about too much overhead.

Option 3: Use Blend() to color the screen. JUST KIDDING...

Unless there's some magic way to have a transparent image/overlay that is completely ignored when figuring out where the user clicked, I think I have to go with Option 2?

If anyone can think of a different solution, or knows a slick way to translate from screen-object to map location, it would be much appreciated!

I think mouse_opacity can solve this issue. Never used it myself.
Best response
if you set an atom to have mouse_opacity=0 it disables all mouse functionality with it, essentially making it invisible to your mouse cursor and allowing you to click on things that are under that atom's icon. so just set the screen object to have that value and your problem should be solved.
LOL

Thanks so much you guys, I'm glad I asked instead of diving straight into a workaround that's not really necessary!