How to draw rectangle over any application?

I have a need to be able to draw a rectangle anywhere on the screen over any application even if the application is in full screen mode.

I've gotten suggestions to create a transparent window the size of the desktop and draw the rectangle in it, but that method won't work when the active app is in full screen mode.

I presume that it's possible to do this being that there are screen annotation applications that can do such things, so I'm looking for suggestions as to how to accomplish this?

Thanks in advance

Replies

I've never really thought about this. But my understanding is that you need to draw inside a window, not directly on screen.

However, you can create NSPanel which will be a floating window over any other app.
But the hud is hidden if other app is in fullscreen mode.

It is declared like this:

Code Block
    @IBOutlet weak var hudPanel  : NSPanel!


BTW: have you checked that what you want complies with HIG ? IMHO not, an app should not be authorised to "block" other apps.